So I'm building a rather large city in which I would like the buildings to be mostly destructable. The way I'm handling it at the moment is working fairly well but I'm not exactly a programmer so I wanted to see if I could be missing any methods of saving even more processing overhead.
At the moment I have a big static cube trigger in the exact dimensions of the building I need. I have a prefab of the same size tower that has been diced up into several hundred rigidbody pieces, (bound together with fixed joints) that spawns when the initial cube trigger is triggered.
When the player starts to destroy the building, pieces moving above a certain velocity spawn a one-shot particle cloud and destroy themselves which helps eliminate a fair bit of the overhead so far while remaining fairly satisfying visually.
Occlusion culling handles the initial trigger buildings pretty well.
So that's where I'm at so far. Perhaps I could limit the number of active rigidbodies allowed at any given time? Anything else? Even if you're not sure if it would work out visually I might be able to use it. I'm completely okay with "cheating" the way you would really expect everything to behave.
Thanks! -Seth
Occlusion culling probably won't do much for Physics. It's a rendering thing not a Physics thing so it shouldn't stop calculations on your rigidbodies.
– Peter_GGlad you like them. Don't forget to mark it the correct answer too though.
– Peter_GOne thing you could look into is to use animations for the destruction of the buildings, to reduce the amount of physics calculations.
– Linus