Batching breaks depending on Child index in root parent....

I have tested for 4 hours and I found out that changing the first child object(which has its own children) to the last child under the root parent fixed batching issues. It was one of 8 child objects under the root parent(each of these 8 has their own children, in my prefab). This makes no sense. I have a prefab of a plant that has 8 different main parents under the root parent. Each of the 8 children of the root parent hold their own multiple children. I messed with the shader, shadow casters, everything under the sun during runtime for 4 hours and I have consistently been able to fix batching by changing waht used to be index 0 of the 8 main children, to the last of the children under the root parent.
So instead of first child, it was moved to last. This fixed the batching. Multiple instances of the prefab would make my batches jump up 50 per instance. This completely fixed the batching. This seems like a tremendous performance issue in Unity 2018.2.4f1 by having the order of an objects child in a root parent affect batching and makes no sense at all. I cannot imagine the performance impact for other people never knowing that the position/order of children objects under a root parent could kill their performance. I saved 600 batches by reordering the child object when the maximum of 18 of these object prefabs are instantiated in my scene.nothing on my prefab changed scale or position wise. the only thing changed was the order of the child objects as I made all changes runtime, one at a time and would reset the player and test another “tweak” on the prefab.

The below picture ParentTopBud was moved from above plantmainbody as first child, to being the last child. this one single thing fixed batching. I don’t care how crazy it sounds, this was the only change made to this prefab.

5173199--513410--temp.PNG

Did you break out the Frame Debugger and see how the various changes you made affected things, see what was happening exactly?

1 Like

Solved, I realized that I was previously not scaling this object. As soon as I scale these objects they loos their batching and when they are done scaling they are back to being batched.

1 Like