Hey all, I am trying to generate a group of cubes without physics so that I can then program something to remove said cubes after they are generated on level launch. However, it produces immense lag. Does anyone know how I can reduce this?
or ( float startX = -64F; startX < 65F; startX ++ )
{
GameObject neuBrick = GameObject.CreatePrimitive(PrimitiveType.Cube);
CurPos = new Vector3(startX,startY,startZ);
// neuBrick.AddComponent<BoxCollider>();
neuBrick.transform.Translate(CurPos);
neuBrick.layer = 8;
if ( startX == 64F )
{
startZ += 1F;
startX = -64F;
}
}
That is not the most recent version, and I have it looping correctly but it creates too much lag. Does someone know how I can fix this?