trouble getting all children into an array.

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.

The transform of your object already contains all it’s children in an array

 foreach(Transform t in transform )

This will get you the child transforms.