Combining Created/Instantiated Primitives

Hello guys. I really want to know answer to this question,i’ve been looking for the answer for almost week,but nothing! So,i thought that you guys could help me!
So heres the thing,i have simple script,it creates primitives (cubes) and it makes cube grid. I need to make very,very wide cube grid,like 100x100 (about 10000 cubes are created).
And of course it gives me alot,alot draw calls like 8 thousand +++
So solution would be to group created primitive meshes or just group them together to reduce draw calls. Or any other method!!!

How to combine created primitives or Instantiated prefabs,that its reducing draw calls

Create primitives:

for (var y = -100; y < 5; ++y)
for (var x = -100; x < 5; ++x) {
var cube : GameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube.transform.position = transform.position + Vector3(x, 0, y);

var MyCube:GameObject;
var Size:Vector3 = Vector3(10,10,10);

Instantiate prefabs (BLOCKS):

function Start() {
for (var x=-Size.x; x<Size.x; x++) for (var y=-Size.y; y<Size.y; y++) for (var z=-Size.z; z<Size.z; z++) {
Instantiate(MyCube, Vector3(x,y,z), Quaternion.identity);
}
}
}

Help me guys,thanks :slight_smile:

google “unity reduce draw calls” => what's the best way to reduce draw calls? - Questions & Answers - Unity Discussions

google “CombineChildren unity” => bunch of answer threads and youtube vids

… need to improve google-fu little one :stuck_out_tongue: