- Home /
Static.Combine issue/bug need help with fix or work around
In my game I am making I am instantiating objects that the player can position, once placed I call static.combine to reduce the draw calls.
after much testing (calling it at different times and running it on objects created in editor vs run time) it turns out that if the objects are already batched with static.combine that they wont re-combine with any new instances of that object
so if I add 50 of the same object and then call static.combine, I get 1 draw call and 50 batched
however if I call static.combine after each instantiate it batches them in pairs, so I would get 25 draw calls and 50 batched (as the pair are batched together it classes this as batched, but not batching the pairs so leaves the 25 draw calls)
this I have a feeling is a limitation of unity's batching system, if it is not how do I fix this issue.
if it is a limitation, is there anyway to un-combine / un-batch the meshes, so then I can re-batch them all on the next frame (I can cope with the potential lag spike rather than constant bad frame rate due to draw calls)
if you can not un-batch objects back to their original state has anyone got any ideas to work around this - bar instantiating all the objects again and then re-batching that and then deleting the old ones (instantiating is expensive, doing one when the player requests is not an issue, however instantiating 100's of objects is not an option)
Your answer
