public void FlyInBattle() { //during battle enemies will not leash to idle if (alert == true) { AlertActions(); } else { AlertActions(); if (target == null) { if (friendly == true) { target = npcManager.GetClosestEnemy(this.gameObject); if (target == this.gameObject) { target = null; } } else { FindTarget(); } } } }