/// <summary> /// Hides canvas when player steps out of the trigger /// </summary> public void OnTriggerExit(Collider other) { TriggerSender hitbox = other.GetComponent <TriggerSender>(); if (hitbox != null && hitbox.GetReciever().GetRecieverGameObject().Equals(player.gameObject) && player.bodyHitbox.Equals(other.gameObject)) { Debug.Log("Close"); dialogCanvas.Close(); } }