return all children of a game object code example
Example 1: unity get all children
foreach (Transform child in parent) {
//Your code
}
Example 2: get all child gameObject of gameObject C#
foreach (Transform child in transform)
foreach (Transform child in parent) {
//Your code
}
foreach (Transform child in transform)