FindGameObjectsWithTag not finding child objects with tag?

I can’t find this in the documentation? I’ve written

private var planets				: GameObject[];

...
function start()
{
        setSizes();
        createHexes(); //this creates the hexes (sectors) with 0 to 3 planets on them
	planets = GameObject.FindGameObjectsWithTag("Planet");
        print (planets.length);
}

But when I check the array to see if it contains the planets, it’s empty. The planets are tagged properly.
Each planet is a child of another object (sector). Sometimes there are more than one child planets to the parent object.

edit: I just saw that it works if I put it into update, but I don’t need it to constantly do it. Only once, at the start. But it just returns an empty array. Same if I put it up awake, or split them up and put setSizes and createHexes in awake and my other code in Start

mine work perfectly (its c# though but i think its the same), here another solution if u still experience the proble put the

planets = GameObject.FindGameObjectsWithTag("Planet")

to Update method and give it state (simple bool value will okay) so it will only executed once per starting the game object

hope this help

are the planets active?

I had a similar problem to this, it was caused by the game objects not being created before the script tried to access them.

This solution may not work for your situation but you can try putting

function Start ()
	{
		yield new WaitForFixedUpdate ();
 // rest of start code
	}

and this in the function Awake()

setSizes();

        createHexes(); //this creates the hexes (sectors) with 0 to 3 planets on them