Best way to optimize scene with multiple instances of a destroyable object

Ok, hopefully my question will make sense :slight_smile:

Basically, I am making a platforming game for iOS and I am having issues with my frame rate. I recently discovered the “combine meshes” script and this has done WONDERS for my game, I can have massive levels with almost no performance hit…

Until I add in collectable coins. The trouble is, when you collect the coins I want to destroy them so they can’t be collected again. Of course with the combine mesh scripts, the original coin and its collider etc is “destroyed” yet its representation in the combined mesh is still present. So I guess using the combine mesh script is out for these types of objects.

When I add in my coins, about 40 or so plain old Unity spheres (no scripts on them, just triggers), I take about a 10 FPS performance hit, and my scene has about 12 extra draw calls. for 40 spheres!

Is there any solution to this problem, something like a combine meshes script but for dynamic or destroyable objects?

I imagine pooling isn’t the solution in this case, because they aren’t being instantiated during the game, and when I destroy them, the FPS goes up!

All suggestions are welcome, I need to squeeze every FPS I can out of this game so I would truly appreciate any help!

Thanks

How many materials are on these spheres? If 40 spheres are all using the same material, no transparencies, same scale, and are the same distance from the camera, it sounds like they should be just 1 draw call.

In my case, I had a “pulsing” animation playing on my coins that were causing all of them to have slightly different scales. This up’d my draw calls and caused a performance hit on the iPad 1. In that case we disabled the animations or made all the coins animate at the same time so they all had the same scale.