void OnBecameInvisible() { GameObject parent = transform.parent.gameObject; print("Destroying " + parent.name); Destroy(parent); groundGen.RemoveFromList(parent); }