diff --git a/Player.gd b/Player.gd index 67a73c5..e379163 100644 --- a/Player.gd +++ b/Player.gd @@ -4,19 +4,27 @@ const GRAVITY = 9.8 var velocity = Vector3.ZERO +var walkDirection = Vector2.ZERO + # Declare member variables here. Examples: # var a = 2 # var b = "text" -func gravity(delta): - self.velocity.y -= GRAVITY * delta +func gravity(): + self.velocity.y -= GRAVITY + +func walk(): + walkDirection = Vector2.ZERO + + #if input func motion(delta): - self.move_and_slide(velocity, Vector3.UP) + self.move_and_slide(velocity * delta, Vector3.UP) #rpc("move_and_slide", velocity, Vector3.UP) func _physics_process(delta): - gravity(delta) + gravity() + walk() motion(delta)