pass over all the sons of an object using a for
how i can pass over all the sons of an object using a for?
thank you all.
Comment
Answer by Bunny83 · Oct 17, 2017 at 10:52 AM
Just use a foreach loop like this:
foreach(Transform child in someObject.transform)
{
// do something with "child"
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612141236im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
[Begginer] [Solved] How to solve a Null Reference Exception 1 Answer
Giant hollow sphere 0 Answers
Image on Costume object faile 0 Answers
Script doesnt work properly on 1 object 0 Answers
Invisible objects 1 Answer