public void Move() { var movement = STATS.Get_Current_Movement(); var action = STATS.Get_Current_Action(); if (!isStunned && (action.Equals(Movement_Direction.Jumping) || action.Equals(Movement_Direction.Neutral))) { if (action == Movement_Direction.Jumping && isGrounded && canJump) { PerformJump(); } if (!isAttacking && !(action == Movement_Direction.Jumping || action == Movement_Direction.Blocking)) { var _horizontal = movement == Movement_Direction.Forward ? 1f : movement == Movement_Direction.Backward ? -1f : 0.0f; playerAnim.SetFloat("Speed", Mathf.Abs(_horizontal)); if (STATS.Get_Player_Sprinting() && isGrounded) { myBody.velocity = new Vector2(_horizontal * Base.Speed * 1.5f, myBody.velocity.y); } else { if (isGrounded) { myBody.velocity = new Vector2(_horizontal * Base.Speed, myBody.velocity.y); } else { myBody.velocity = new Vector2(myBody.velocity.x, myBody.velocity.y); } } } } int set = -1; if (action.Equals(Movement_Direction.Crouching) || action.Equals(Movement_Direction.Crouch_Blocking) || action.Equals(Movement_Direction.Blocking)) { switch (action) { case Movement_Direction.Crouching: set = 0; break; case Movement_Direction.Crouch_Blocking: set = 0; break; case Movement_Direction.Blocking: set = 4; break; } } else { switch (movement) { case Movement_Direction.Neutral: set = 1; break; case Movement_Direction.Forward: set = 2; break; case Movement_Direction.Backward: set = 3; break; default: set = -1; break; } } playerAnim.SetInteger("Movement", set); }