private void OnTriggerEnter(Collider other) { if (other.gameObject.layer == terrainLayer) { timeElapsed = travelTime; return; } BulletController bulletController = other.GetComponent <BulletController>(); if (bulletController != null) { bulletController.Attach(transform); } }