feat: Sample Air Movement Updated

- AirMovement1D updated to slow down if it's going faster than the BaseSpeed along X axis
This commit is contained in:
Syntriax 2023-03-21 16:30:01 +03:00
parent 119cc2c628
commit 9bd1b3cd4a
1 changed files with 1 additions and 5 deletions

View File

@ -33,12 +33,8 @@ namespace Syntriax.Modules.Movement.Samples
velocity.x += moveValue * Time.fixedDeltaTime;
if (moveValue != 0f)
{
if (Mathf.Abs(velocity.x) > Mathf.Abs(moveValue))
velocity.x = moveValue;
else if (Mathf.Abs(velocity.x - moveValue) > Mathf.Abs(moveValue))
velocity.x += moveValue * Time.fixedDeltaTime;
}
velocity.x *= .95f;
rigid.velocity = velocity;
}