rotation speed changed to exact player movement speed

This commit is contained in:
2023-01-03 18:49:23 +01:00
parent 3ba39263e0
commit 0234bf3fc8

View File

@@ -32,7 +32,7 @@ public partial class player : CharacterBody3D
velocity.x = direction.x * Speed;
velocity.z = direction.z * Speed;
Vector3 bodyRotation = GetNode<MeshInstance3D>("collision/body").Rotation;
bodyRotation.y = Mathf.LerpAngle(bodyRotation.y,Mathf.Atan2(-direction.x, -direction.z), (float)delta * Speed * 1.5f);
bodyRotation.y = Mathf.LerpAngle(bodyRotation.y,Mathf.Atan2(-direction.x, -direction.z), (float)delta * Speed);
GetNode<MeshInstance3D>("collision/body").Rotation = bodyRotation;
}
else