private void OnTriggerEnter(Collider other) { // if colliding with enemy action collider change to combat state if (other.gameObject.CompareTag("Action_Collider") && other.transform.parent.gameObject.CompareTag(_tag)) { Troop _thisTroop = _parentGameObject.GetComponent <Troop>(); _thisTroop.currentTarget = other.transform.parent.gameObject.GetComponent <Troop>(); _thisTroop.ChangeState(new Combat(_thisTroop)); } }