foreach child in gameobject unity code example Example: unity foreach child foreach(Transform child in transform) { print(child.gameObject.name) }