how to clear all child from gameobject in unity code example
Example: unity delete all children
foreach (Transform child in transform) {
Destroy(child.gameObject);
}
foreach (Transform child in transform) {
Destroy(child.gameObject);
}