// I think this function is probably a mess (but not a huge mess) public void AggroAICharacters() { StateController myStateController = GetComponent <StateController>(); Collider[] colliders = Physics.OverlapSphere(transform.position, allyAggroDistance); for (int i = 0; i < colliders.Length; i++) { AICharacter aiCharacter = colliders[i].GetComponent <AICharacter>(); if (aiCharacter != null && !aiCharacter.fov.isActive) { aiCharacter.Aggro(myStateController.target); } } }