From 3acc432956edb8593ed08dd0ed35ee7c640b2560 Mon Sep 17 00:00:00 2001 From: vaporvee Date: Mon, 2 Jan 2023 18:41:56 +0100 Subject: [PATCH] fixed direction rotation --- src/player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/player.cs b/src/player.cs index 8c13a1d..08c62f2 100644 --- a/src/player.cs +++ b/src/player.cs @@ -32,7 +32,7 @@ public partial class player : CharacterBody3D velocity.x = direction.x * Speed; velocity.z = direction.z * Speed; Vector3 bodyRotation = GetNode("collision/body").Rotation; - bodyRotation.y = Mathf.LerpAngle(bodyRotation.y,Mathf.Atan2(-inputDir.x, -inputDir.y), (float)delta * Speed); + bodyRotation.y = Mathf.LerpAngle(bodyRotation.y,Mathf.Atan2(-direction.x, -direction.z), (float)delta * Speed); GetNode("collision/body").Rotation = bodyRotation; } else