fixed combining branch

This commit is contained in:
slevy14
2023-04-27 20:12:07 -07:00
parent 1b634fd829
commit 153a1b4f8d
3 changed files with 17 additions and 7 deletions

View File

@@ -97,6 +97,12 @@ public class PlayerMovement : MonoBehaviour
CheckDirectionToFace(_moveInput.x > 0);
#endregion
if (!IsJumping) {
print("not jumping");
} else {
print("jumping, " + RB.velocity.y);
}
#region COLLISION CHECKS
if (!IsJumping)
{
@@ -119,12 +125,14 @@ public class PlayerMovement : MonoBehaviour
//Two checks needed for both left and right walls since whenever the play turns the wall checkPoints swap sides
LastOnWallTime = Mathf.Max(LastOnWallLeftTime, LastOnWallRightTime);
}
#endregion
#region JUMP CHECKS
if (IsJumping && RB.velocity.y < 0)
if (IsJumping && RB.velocity.y <= 0)
{
IsJumping = false;
print("isJumping " + IsJumping);
if (!IsWallJumping)
_isJumpFalling = true;
@@ -216,7 +224,6 @@ public class PlayerMovement : MonoBehaviour
SetGravityScale(Data.gravityScale);
}
#endregion
}
}
private void FixedUpdate()
@@ -419,6 +426,7 @@ public class PlayerMovement : MonoBehaviour
}
public bool IsGrounded() {
// print(Physics2D.OverlapBox(this.transform.position, _groundCheckSize, 0, _groundLayer) && !IsJumping);
return (Physics2D.OverlapBox(this.transform.position, _groundCheckSize, 0, _groundLayer) && !IsJumping);
}
#endregion