Cannot cast form source type to destination type?

Trying to get child transforms, store them in a transform array.

childTransforms : Transform[];
thisTransform : Transform;

childTransforms = thisTransform.transform.GetComponentsInChildren(Transform);

Do I need to just use GameObject for thisTransform?..
Edit:nope that doesnt work either.

Don’t need to define thisTransform, all you need to use is ‘transform’ for that. You also need to use var… Just to clean things up, I’d make a Generic List instead of array.

#pragma strict

import System.Collections.Generic;

var children : List.<Transform> = new List.<Transform>();

function Start () 
{
	for(var t in transform)
		children.Add(t);
		
	for(var c in children)
		print(c.name);
}

GetComponentsInChildren returns a Component array, not a Transform array.

e.g.

Component[] components = transform.GetComponentsInChildren(Transform);