private void OnTriggerExit(Collider other) { HQ dock = GetComponentInParent <HQ>(); if (other.tag == "ship") { Ship othership = other.GetComponent <Ship>(); if (othership.getTeam() == dock.getTeam()) { dock.removeAllyShip(othership); } else { dock.removeEnemyShip(othership); } } }