fixed what happens if the player is grappling and dies

This commit is contained in:
Sam 2023-05-04 14:25:13 -07:00
parent 2dd782e72f
commit da4a9efbdd

View File

@ -83,7 +83,7 @@ public class PlayerBehavior : MonoBehaviour
{
AttemptGrapple();
}
if (playerInput.actions["Grapple"].WasReleasedThisFrame())
if (playerInput.actions["Grapple"].WasReleasedThisFrame() && grapplingRope.isGrappling)
{
LetGoOfGrapple();
}
@ -315,6 +315,10 @@ public class PlayerBehavior : MonoBehaviour
// this.stateController.SetDeathCanvasActive(true);
if (grapplingRope.isGrappling) {
LetGoOfGrapple();
}
// destroy all tambourines
GameObject[] currentTambourines = GameObject.FindGameObjectsWithTag("tambourine");
foreach (GameObject tambourine in currentTambourines)