public override void Update() { base.Update(); _movement.CheckIfShouldFlip(_input.XInputRaw); // if we're holding downwards if (_input.YInputRaw <= 0 && _input.XInputRaw == 0) { _stateMachine.ChangeState(_stateMachine.CrouchState); return; } // if we're moving sideways, and not touching the ceiling }
public override void Update() { _movement.CheckIfShouldFlip(_input.XInputRaw); if (_input.XInputRaw != 0) { _stateMachine.ChangeState(_stateMachine.MoveState); return; } else if (_input.XInputRaw == 0 && _input.YInputRaw < 0 && _data.AllowCrouch) { _stateMachine.ChangeState(_stateMachine.CrouchState); return; } base.Update(); }