Instantiate and combine, now can't see anything

Hi All,

I’ve had a rummage around for an answer but it’s eluding me. I think it’s a simple problem…

I’ve created an array of cubes in random locations by instantiating a common object. All great so far apart from the excessive Draw Call count. So now I’m trying to combine the children to reduce the Draw Calls using the combine children script.

The instances get parented to an empty node, the combine script is on the empty node and the draw calls now drop to 1, great but the instanced cubes don’t render anymore - or if they do they’re all located on top of each other (I guess?). Either way I can’t see anything apart from my original common object.

Note I can see the green outlines of the instanced objects transforms in the Scene view in their random positions, but nothing in the Game view.

What am I missing?

using UnityEngine;
using System.Collections;

public class MakeColouredCubes : MonoBehaviour {

public Transform parent;
public GameObject baseCube;

	GameObject[] go;
	static int TOTAL=100;
	Vector3[] v;
	// Use this for initialization
	void Start () {
		go = new GameObject[TOTAL];
		v=new Vector3[TOTAL];
	
		for (int n=0; n<TOTAL; n++)
		{
			v[n]=Random.insideUnitSphere * 100;	
			go[n]=(GameObject)Instantiate(baseCube,v[n], transform.rotation);
			go[n].transform.parent = parent;
			go[n].name = n.ToString();
		}
	}
	
	// Update is called once per frame
	void Update () {
	}
}

NCarter has come up with the solution via IRC.

I needed to use Awake() instead of Start() for my instantiation function as the Combine children script likes it that way.

Thanks NCarter!