nerfed raycasting while using gamepads

This commit is contained in:
2022-12-31 21:04:43 +01:00
parent ff3aad1b4a
commit 126d9eb77a
2 changed files with 6 additions and 6 deletions

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");
if(movement.Length() != 0) rotCenter.Rotation = movement.Angle();
if(movement.Length() != 0) rotCenter.Rotation = new Vector2((float)Math.Round(movement.x,0),(float)Math.Round(movement.y,0)).Angle();
MoveAndCollide(movement * speed * (float)delta);
}
public override void _Process(double delta)