From d923fc700cc352739e920981cdc38c7f6c7258d5 Mon Sep 17 00:00:00 2001 From: unfa Date: Sun, 14 Jun 2020 02:09:52 +0200 Subject: [PATCH] Walking moves forward taking rotation into account --- Player.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Player.gd b/Player.gd index a9791f8..3663f20 100644 --- a/Player.gd +++ b/Player.gd @@ -35,7 +35,7 @@ remote func jump(): velocity.y = JUMP_VELOCITY func motion(delta): - self.move_and_slide(velocity * delta, Vector3.UP) + self.move_and_slide(velocity.rotated(Vector3.UP, self.rotation.y) * delta, Vector3.UP) func _physics_process(delta): gravity()