i want to get all the gameobjects under a gameobjects even if they are the children of the children of the children …
is there a specific method or should i use loop, if loop then how?
i want to get all the gameobjects under a gameobjects even if they are the children of the children of the children …
is there a specific method or should i use loop, if loop then how?
GetComponentsInChildren();
Every gameobject has a transform, so you can get all transforms and reference transform.gameobject.
NOTE: This will also get the transform of the gameobject the component is attached to (The parent gameobject). You’ll have to remove it from the array.