- Home /
Static Batching Weird Bug
I've noticed a weird bug while trying to achieve static batching. Say I have 5 models A,B,C,D,E that I've imported into project and I setup them for static batching. I make prefabs of all the models and assign material. In Hierarchy I add them and mark as static. Now the bug is that Instead of 1 draw call even tough they use the same material I get 2 or more. The bug is that for example model A is somehow breaking the batching and when I disable it i get 1 draw call, but I can't have that model. The workaround is to copy/duplicate say model B and change it's mesh to that of model A and then this model gets batched and I can now use model A.
Anyone noticed this kind of bug, and/or has any ideas how to fix it without using this "technique"?
Thank you in advance
EDIT:
As an additional problem and info, the material uses Unlit/Transparent shader. The additional problem is that I have two textures, one with flat shadows and other with road textures and when they are separate active (just road or just shadows) batching works, however when I activate both batching seems to break. No idea why, this is just plain stupid.
EDIT 2:
So I think after testing the bug is definitely because of Unlit/Transparent shader if i change it to some other then it works. But the problem now is that the models of road or shadows can't be just plains with transparent texture on themselves. If someone has any kind of solution to this i would be eternally grateful.
Your answer
![](https://koobas.hobune.stream/wayback/20220613163737im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Static Batching at Runtime 2 Answers
Procedural meshes: static batching seemingly inoperative. Cause? 1 Answer
Clamping acts strange with public static values? 0 Answers
difference between static and Dynamic Batching 1 Answer
When Static Batching and building, objects checked Static do not appear 1 Answer