Static Batching: Trade-off or simply misunderstood

I’ve been battling to get my project to compile to a reasonable size. I tried a lot of things, some of them logical, some just plain whacky. Until I got a niggly feeling that static batching may be to blame. So I disable static batching in my player and I’m treated to a level that has reduced from 18.5mb to 403Kb.

So it would seem that static batching combines multiple meshes into one MEGA mesh and saves it into your level file… Which is kinda silly.

Now, there is a question in here somewhere. Is there always a trade-off between the rendering benefit of static batching and the buggerup of huge files or is there a middle ground?

Your thoughts and opinions are most appreciated, thanks.

The numbers sound a lot like some massive bug.

Never seen any such drastic changes.

Hi,

we had the same problem. But you can have both benefits if you just add a gameobject with a script above all your gameobjects that you want to be static batched. Just call:

StaticBatchingUtility.Combine(this.gameObject);

Thanks, DomBomDom! Works like a charm so far :slight_smile: