File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed 
3d/kinematic_character/player Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -5,22 +5,24 @@ const JUMP_SPEED = 5
55const  ACCELERATION  =  2 
66const  DECELERATION  =  4 
77
8+ onready  var  camera  =  $ Target/Camera 
89onready  var  gravity  =  - ProjectSettings .get_setting ("physics/3d/default_gravity" )
10+ onready  var  start_position  =  translation 
911var  velocity : Vector3 
1012
1113func  _physics_process (delta ):
1214	if  Input .is_action_just_pressed ("exit" ):
1315		get_tree ().quit ()
1416	if  Input .is_action_just_pressed ("reset_position" ):
15- 		translation  =  Vector3 ( - 3 ,  4 ,  8 ) 
17+ 		translation  =  start_position 
1618
1719	var  dir  =  Vector3 ()
1820	dir .x  =  Input .get_action_strength ("move_right" ) -  Input .get_action_strength ("move_left" )
1921	dir .z  =  Input .get_action_strength ("move_back" ) -  Input .get_action_strength ("move_forward" )
2022
2123	#  Get the camera's transform basis, but remove the X rotation such
2224	#  that the Y axis is up and Z is horizontal.
23- 	var  cam_basis  =  $ Target/Camera .global_transform .basis 
25+ 	var  cam_basis  =  camera .global_transform .basis 
2426	var  basis  =  cam_basis .rotated (cam_basis .x , - cam_basis .get_euler ().x )
2527	dir  =  basis .xform (dir )
2628
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments