From 34e0c028fb71c3f966095d55de63c041153d2ab9 Mon Sep 17 00:00:00 2001 From: Tetane Date: Mon, 18 Sep 2023 19:49:53 +0200 Subject: [PATCH] Check velocity length without y axis --- scripts/player.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/player.gd b/scripts/player.gd index 43fe7e2..55a6409 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -48,7 +48,7 @@ func _physics_process(delta): # Rotation - if velocity.length() > 0: + if Vector2(velocity.z, velocity.x).length() > 0: rotation_direction = Vector2(velocity.z, velocity.x).angle() rotation.y = lerp_angle(rotation.y, rotation_direction, delta * 10)