Move Player on 1 axis
This commit is contained in:
		
							parent
							
								
									206bf0ae44
								
							
						
					
					
						commit
						77f6ec358b
					
				
					 1 changed files with 11 additions and 8 deletions
				
			
		
							
								
								
									
										19
									
								
								Player.gd
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								Player.gd
									
										
									
									
									
								
							| 
						 | 
					@ -3,16 +3,19 @@ extends KinematicBody
 | 
				
			||||||
var velocity = Vector3()
 | 
					var velocity = Vector3()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func _ready():
 | 
					func _ready():
 | 
				
			||||||
	# Called every time the node is added to the scene.
 | 
						print("player init")
 | 
				
			||||||
	# Initialization here
 | 
					 | 
				
			||||||
	pass
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
func _physics_process(delta):
 | 
					func _physics_process(delta):
 | 
				
			||||||
	var direction = Vector3()
 | 
						var direction = Vector3()
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
#	if Input.is_action_pressed("movement_forward"):
 | 
						if Input.is_action_pressed("ui_up"):
 | 
				
			||||||
 | 
							print("Onward!")
 | 
				
			||||||
 | 
							self.translate(Vector3(0, 0, 1))
 | 
				
			||||||
 | 
						if Input.is_action_pressed("ui_down"):
 | 
				
			||||||
 | 
							print("not so onward...")
 | 
				
			||||||
 | 
							self.translate(Vector3(0, 0, -1))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#func _process(delta):
 | 
					func _process(delta):
 | 
				
			||||||
#	# Called every frame. Delta is time since last frame.
 | 
						# Called every frame. Delta is time since last frame.
 | 
				
			||||||
#	# Update game logic here.
 | 
						# Update game logic here.
 | 
				
			||||||
#	pass
 | 
						pass
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue