fixed resetting rotationCenter on zero movement

This commit is contained in:
2022-12-29 18:20:34 +01:00
parent 307ccf071f
commit aa0d32ae85

View File

@@ -22,7 +22,7 @@ public partial class player : CharacterBody2D
public override void _PhysicsProcess(double delta)
{
movement = Input.GetVector("move_left", "move_right", "move_up", "move_down");
rotCenter.Rotation = movement.Angle();
if(movement.Length() != 0) rotCenter.Rotation = movement.Angle();
MoveAndCollide(movement * speed * (float)delta);
}
public override void _Process(double delta)