Is there a way to instantiate 80.000 cubes without freezing Unity or yielding errors shown below for the time-delayed generation of 80k gameobject cubes:
void Start () { StartCoroutine (Inst()); } IEnumerator Inst(){ for(int i=0;i<80000;i++){ if(i%1000==0)yield return new WaitForSeconds(2f); GameObject g = Instantiate (goCube,new Vector3(i,0,0),Quaternion.identity) as GameObject; g.name = "Cube"+i.ToString(); } }
Unable to create broadphase entity.
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
c__Iterator0:MoveNext() (at Assets/scrawl/gencubestest.cs:15)
Actor Initialisation failed: returned NULL.
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
c__Iterator0:MoveNext() (at Assets/scrawl/gencubestest.cs:15)
Could not create actor. Maybe you are using too many colliders or rigidbodies in your scene?
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
c__Iterator0:MoveNext() (at Assets/scrawl/gencubestest.cs:15)