Skip to content

Commit

Permalink
fix: covered an edge case where player can be holding but not on hold
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniol0012 committed Dec 11, 2024
1 parent 1124df0 commit b56fde3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Assets/Scripts/Mechanics/Movement/Hold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using UnityEngine;

namespace Mechanics.Movement {
[RequireComponent(typeof(PlayerController))]
public class Hold : MonoBehaviour {
[SerializeField] private LedgeDetection ledgeCheck;
[SerializeField] private PlayerController player;
Expand Down Expand Up @@ -40,6 +41,8 @@ private void Update() {

if (isHolding && GetUpKey() && player.movementState == PlayerMovementState.Hold) {
ClimbLedge();
} else if (isHolding && GetUpKey()) {
EndHold();
}
}

Expand Down

0 comments on commit b56fde3

Please sign in to comment.