//Leaving Detection Sphere void OnTriggerExit(Collider other) { if (other.gameObject.tag == typeOfTarget.ToString()) { //Debug.Log ("Lost Target"); if (senseTarget != null) { ai.GoInvestigate(other.transform.position); } targetInSight = false; senseTarget = null; ai.targeting = false; ai.myTarget = null; } }