- Home /
having over 100.000 cubes in one scene
Hey everyone. Im experimenting with having a lot of objects in one scene. In my experiment there needs to be a lot of houses, made out of cubes. Lets say that one of the houses is made out of 2000 cubes. But if you then play the game, it lags alot. It even lags in the editor. How can i optimize cubes so that there can be over 100.000 cubes in one scene? The game is a city with a lot of houses made out of these cubes. The only thing thats needs to be attached to the cubes is rigidbody, collider, and mesh renderer.
I suppose i could do that as one thing. But right now i only have one building with 1800 cubes, and it lags even if i only look at that.
You simply cannot have that many objects. is there a reason why you have so many cubes? are you by any chance making a Voxel game?
$$anonymous$$mm i wouldt call it that. The plan is a fighting game, where you are giants in a city. You fight and if you hit the houses that are made of cubes, they will collapse.
I dont think that your method will work for this kind of game, you would ins$$anonymous$$d want to have custom models for each building, then some sort of damaged model / animation to play upon them being hit by checking with maybe a raycast, then changing to the destroyed building and spawning particle effects or something to simulate smoke.