destroy parent gameObject unity code example
Example 1: unity remove parent
transform.parent = null;
Example 2: destroy all objects under parent unity c#
foreach (Transform child in TextHolder.transform) { GameObject.Destroy(child.gameObject); }
Example 3: how to destroy parent gameobject unity
Destroy(transform.parent.gameObject);