BoxColliders without gameObject overhead?

I need to include several thousand static boxes in my scene, and each of one of those requires a game object, which causes insane slowdown. I know there is a mesh collider, but it isn’t suited for my purposes. As I need to be able to edit the mesh at whim, and each time I set MeshCollider.sharedMesh, it causes a 5-10 frame hiccup. Is there anything else I could do in my situation? Any ideas are appreciated. Because otherwise I’m thinking I’ll have to write my own de facto physics engine. Which would be a painful as I have piss poor knowledge of vector algebra.

this is because editing any colliders marked as static will cause precomputation for optimization to take place. Don’t mark them as static, in fact you may get higher performance if they have rigid bodies. Experiment.

The slowdown is caused by having several thousand boxes, not the GameObjects. There’s a limit to what you can do with the physics engine, and you’ve apparently gone over it. It’s impossible to have components without GameObjects, which are merely containers for components, and have no real overhead by themselves (aside from RAM). For example, if I have an empty scene, and then I add a script that creates several thousand empty GameObjects, the framerate is the same in both cases.

–Eric

Hmm it seems you’re right. The game object really doesn’t have an effect on the FPS, but when you have 200k or so of them, you just end up running out of RAM. I guess I’ll have to make do with mesh colliders for now. I’ve optimized my mesh rebuilding code anyways. So the hiccup is barely noticeable now.