I’ve be searching for a way to get access to children of a separate object, so that I can have their positions, but the only method I could find regarding getting multiple children from one transform was:
// Moves all transform children 10 units upwards!
for (var child : Transform in transform) {
child.position += Vector3.up * 10.0;
}
So is there a way to rephrase this to get transforms from other objects? I am looking to do something like this:
for (var child : Transform in transform) {
objectPositions _= child*.position;*_
}
GetComponentsInChildren would probably help.
I’m not certain of the JavaScript syntax, but it’d probably be something along the lines of
var otherTransforms : Transform[];
otherTransforms = otherObject.GetComponentsInChildren(Transform);
for (var trans : Transform in otherTransforms)
{
// Do things with each transform
}
would probably do the trick