From 61939d5090c2971fbe20f7be3da352c5d2e3ecf9 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 1 May 2023 02:12:06 -0700 Subject: [PATCH] fixed double jump the player can no longer jump twice in the air if they walk off a ledge --- Assets/Scripts/PlayerController.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 09cfc29..1058eee 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -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;