diff --git a/Assets/Scripts/GrappleHook.cs b/Assets/Scripts/GrappleHook.cs index c831c64..0237eeb 100644 --- a/Assets/Scripts/GrappleHook.cs +++ b/Assets/Scripts/GrappleHook.cs @@ -179,8 +179,9 @@ public void Stun(float duration){ Invoke("UnStun", duration); } -public void Unhook(){ - EndGrapple(); +public void Unhook(GameObject hookedObj){ + if(hookedObj.Equals(hookedTo)) + EndGrapple(); } #endregion diff --git a/Assets/Scripts/Vanisher.cs b/Assets/Scripts/Vanisher.cs index c126c0a..d468815 100644 --- a/Assets/Scripts/Vanisher.cs +++ b/Assets/Scripts/Vanisher.cs @@ -39,7 +39,7 @@ public class Vanisher : MonoBehaviour } private void Vanish(){ - grapple?.Unhook(); + grapple?.Unhook(this.gameObject); gameObject.SetActive(false); Invoke("Appear", timeToAppear); isVanishing = false;