This will destroy all child objects of a given GameObject (‘go’) : –

 // Remove all child objects
 foreach (Transform child in go.transform)
     Destroy(child.gameObject);

 

 


Discover more from

Subscribe to get the latest posts sent to your email.

One response to “Unity: Destroy all child GameObjects”

  1. thanks for help
    that so useful

Leave a comment

Trending