mirror of
https://github.com/Kizuren/ShantiManti.git
synced 2025-12-21 21:16:04 +01:00
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:
parent
022b621bcb
commit
6f205b0a3e
1 changed files with 6 additions and 0 deletions
|
|
@ -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 =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue