If you are using lightweight/universal render pipeline (LWRP / URP), there is a bug in Unity of too agressive batching. For this we have added a parameter Fix Draw Order
in the Advanced
section of the SkeletonRenderer
inspector.
If this does not help, you could also add a SortingGroup
Component to the GameObject to prevent any wrong grouping / reordering.
If none of the above options resolves your issue, then please send us a minimal Unity project that still shows the problem as a zip package to contact@esotericsoftware.com, then we can have a look at it.
krutovig wrote I don't get your comment about ordering. I can't change the order.
The referenced posting was trying to explain that if the attachments are on two different atlas pages and your order is as is (alternating atlas pages A B A
), then material A
will be listed twice. You can of course not change the order. What you can perhaps change (depending on your attachment sizes), is to re-arrange attachments so that when order is 1, 2, 3
that they are grouped by order to atlas page texture A = 1,2
and texture B = 3
(drawing AA B
) instead of A = 1,3
and B = 2
(drawing A B A
), then you can save one draw call and see only two materials where you now see three.