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