private void OnTriggerEnter(Collider other) { if (other.transform.tag == "pipe") { Destroy(other.transform.parent.transform.parent.gameObject); om.GenerateSingleObstacle(); } }