Last active
January 29, 2019 18:56
-
-
Save michaelmendoza/5017814e589d2ce144a871011f914025 to your computer and use it in GitHub Desktop.
Unity Script to destroy all children gameobjects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void destroyChildren(GameObject gameObject) { | |
foreach (Transform child in gameObject.transform) | |
GameObject.Destroy(child.gameObject); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment