Hello everybody!
I’m trying to make a game minecraft like, and i’m having problems with GameObjects load on Unity3D.
I have a Cube, with a material texture with 180 bytes. And when I try to start the game with more then 30k cubes, I take about 3 minutos to start and is sooo laggy…
There is any better way to load a huge ammount of objects then simple creating a new GameObject?
This is my code:
GameObject newCube = GameObject.CreatePrimitive(PrimitiveType.Cube);
GameObject model = GameObject.FindGameObjectWithTag("MyModel");
newCube.transform.position = new Vector3(x,y,z);
newCube.renderer.material.CopyPropertiesFromMaterial(model.renderer.material);
newCube.renderer.material.name = model.renderer.material.name;