diff --git a/Assets/_Content/Scripts/Player.cs b/Assets/_Content/Scripts/Player.cs index 0eba969..ca087ff 100644 --- a/Assets/_Content/Scripts/Player.cs +++ b/Assets/_Content/Scripts/Player.cs @@ -298,7 +298,28 @@ public class Player : MonoBehaviour private void SetState() { - + if (State.IsGrounded) + { + if (State.HorizontalVelocity.sqrMagnitude > .1f) + { + State.CurrentState = PlayerState.Moving; + } + else + { + State.CurrentState = PlayerState.Idle; + } + } + else + { + if (State.VerticalVelocity > 0) + { + State.CurrentState = PlayerState.Jumping; + } + else + { + State.CurrentState = PlayerState.Falling; + } + } } #endregion }