void OnTriggerExit(Collider other) { // If the player leaves the trigger zone... if (other.gameObject == player) // ... the player is not in sight. playerInSight = false; }