void OnTriggerExit(Collider other) { if (other.gameObject == target) { GetComponent <Animator>().SetBool("isAttacking", false); enemyInRange = false; controller.FindNextTarget(); } }