how do you make an array from all the gameobjects that are childern of a gameobject?
that here below doesn’t work ![]()
The parent/child relationships are handled by the Transform class. You can iterate through all the children of a transform with the technique shown right at the top of the Transform manual page. To put the children in an array, you could use something like the following:-
var children: Transform[] = new Transform[transform.childCount];
var count: int = 0;
for (child: Transform in transform) {
children[count++] = child;
}