public void CheckLineOfSight() { for (int i = 0; i < enemiesMinionList.Count; i++) { var newEnemy = enemiesMinionList[i].GetComponent <MinionController>(); if (newEnemy != null) { lineOfSight.SetTarget(newEnemy.gameObject); // Sets current target. lineOfSight.IsInSight(); // Runs Line of Sight. if (lineOfSight.SawTarget() && teamBoss.isFlee == false) // If saw Target and BOSS not flee. { currentEnemy = newEnemy.transform; AlertAllies(); // Transition Allies to Pursuit. } } } }