Removed a bug when jumping

Removed the bug when jumping.
If you jump, the Y-axis gets higher and the x-axis a bit lower due to vectors.
I put a switch to don't impact the speed while jumping
This commit is contained in:
MarcUs7 2024-12-28 22:57:43 +01:00
parent 022b621bcb
commit 6f205b0a3e

View file

@ -34,6 +34,12 @@ public class PlayerMovement : MonoBehaviour
InputActions.Player.Move.performed += ctx =>
{
_movementInputNormalized = ctx.ReadValue<Vector2>();
_movementInputNormalized.x = _movementInputNormalized.x switch
{
> 0 => 1,
< 0 => -1,
_ => 0
};
_movementInput = _movementInputNormalized * _speed;
};
InputActions.Player.Move.canceled += ctx =>