fixed double jump
the player can no longer jump twice in the air if they walk off a ledge
This commit is contained in:
		@@ -37,6 +37,7 @@ public class PlayerMovement : MonoBehaviour
 | 
			
		||||
    //Jump
 | 
			
		||||
    private bool _isJumpCut;
 | 
			
		||||
    private bool _isJumpFalling;
 | 
			
		||||
    private bool isRegFalling;
 | 
			
		||||
 | 
			
		||||
    //Wall Jump
 | 
			
		||||
    private float _wallJumpStartTime;
 | 
			
		||||
@@ -131,9 +132,20 @@ public class PlayerMovement : MonoBehaviour
 | 
			
		||||
                if (unlockedTrumpet) {
 | 
			
		||||
                    trumpet = 2;
 | 
			
		||||
                } else {
 | 
			
		||||
                    trumpet = 0;
 | 
			
		||||
                    trumpet = -1;
 | 
			
		||||
                }
 | 
			
		||||
                wasGrappling = false;
 | 
			
		||||
                isRegFalling = false;
 | 
			
		||||
            } else {
 | 
			
		||||
                // print("not jumping");
 | 
			
		||||
                if(!_isJumpFalling && !isRegFalling) {
 | 
			
		||||
                    if(unlockedTrumpet) {
 | 
			
		||||
                        trumpet = 1;
 | 
			
		||||
                    } else {
 | 
			
		||||
                        trumpet = -1;
 | 
			
		||||
                    }
 | 
			
		||||
                    isRegFalling = true;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            //Right Wall Check
 | 
			
		||||
@@ -155,7 +167,7 @@ public class PlayerMovement : MonoBehaviour
 | 
			
		||||
        if (IsJumping && RB.velocity.y <= 0)
 | 
			
		||||
        {
 | 
			
		||||
            IsJumping = false;
 | 
			
		||||
            print("isJumping " + IsJumping);
 | 
			
		||||
            // print("isJumping " + IsJumping);
 | 
			
		||||
 | 
			
		||||
            if (!IsWallJumping)
 | 
			
		||||
                _isJumpFalling = true;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user