void OnTriggerExit(Collider col) { if (col.gameObject.CompareTag("Spaceship")) { nearSpaceship = false; spaceship = null; } }
void OnTriggerEnter(Collider col) { if (col.gameObject.CompareTag("Spaceship")) { nearSpaceship = true; spaceship = col.gameObject.GetComponent <SpaceshipFixing>(); } }