I'm trying to get all the children of an object into a Transform[] variable like so:
#pragma strict
var tiles:Transform[];
function Start ()
{
tiles = gameObject.GetComponentsInChildren(Transform) as Transform[];
}
I'm not sure about the "as Transform[];" bit, but I get a warning about implicit downcasting from component to transform if I don't have that in there.
anyway, I don't get any errors but when I run that, nothing happens, and I don't know why.
↧