in my game, i want to give it a “programmer art” look. I was thinking that i could use a bunch of cubes for a lot of the level. one thing i was wondering though, would it be faster to draw a bunch of cubes, or would it work better to just put the equivalent amount of polygons into a model? my theory is that there would be less loading time to draw a bunch of cubes since unity wouldn’t have to access any data to load a cube. But since this would result in a large number of game objects, it might slow down the game. Does anyone know if the number of game objects in the scene affects the speed of the game, as apposed to the same number of polygons in the level being put into one model?
oh, and one other thing that is a little bit unrelated:
some of my objects use a rigid body to detect collision. in the rigid body, i have gravity off and rotation frozen, so basically it doesn’t do anything but tell me when the object hit something. does the rigid body take up much cpu power? enough to make it worth it to find another way to detect collision using a sphere collider attached to my object?
(sorry for putting two questions in one topic)
Generally, it is better to use a single mesh rather than lots of cubes. A well-designed model can use fewer triangles than would be used by all the separate cube faces.
As regards the rigidbody, if you only need it to detect collisions, then switch on the isKinematic setting. If you don’t, the rigidbody object will be moved by collisions as if it were floating in space.
If you do opt for the many cubes, you will help your rendering by having them all share a material (dynamic batching)…you’ll see that in the Stats window in the editor.