My character is comprised of ~10 sprites. When using a submesh separator, my Mesh Renderer has 2 materials.

When I attach sprites as runtime, I can only ever see 2 of them. It seems to be the last 2 in the draw order. When I increase my submesh separators, I begin seeing more of my attached sprites. It seems to always show however many materials I have in my MeshRenderer. I believe this is due to the logic in SkeletonUtilitySubmeshRenderer and how it matches submeshIndex to a material.

I tried a workaround and just doing a submesh separator on everything, so I can see all of my sprites, but I can't get it to show the last (front-most) sprite.

Any ideas what might be going on here?


I am trying to place my own GameObject with a BoneFollower onto my character. I need it to render in the middle of the draw order. The use-case is pretty spot-on with the submesh video tutorials I have seen, it just doesn't seem to work with runtime attachments.
  • Messaggi: 9


Submesh Renderers only configure themselves when you click "Spawn Submeshes" so if you add a new thing during runtime and it generates a new drawcall requirement, it won't understand. You can fix this the ghetto way by simply manually cloning the submesh renderers until you have the maximum you'll need (and also setting their Mesh Index)


You can improve SkeletonUtilitySubmeshRenderer to do a better job and handle your case for you :)

I'm aware that SkeletonUtility in general has been neglected. I'm waiting for Spine 3.0 before I spend my freetime making it any better because its pretty much going to have to get re-implemented from scratch.
Avatar utente

  • Messaggi: 978

Torna a Unity