- تم التحرير
Sprite Sort Point for Spine?
Hello,
We're trying to use 'Transparency Sort Axis' for ordering objects in the 2d game world. But it doesn't work as expected because sorting is done with not the pivot but the center point of spine animation.
https://forum.unity.com/threads/transparency-sort-axis-inconsistency.485814/
To solve this, Unity introduced Sprite Sort Point option in Sprite Renderer.
Does Spine support something like this or have any plans?
Or any ideas to make this work?
Thank you.
The Spine-Unity rendering components only exposes the sorting properties of MeshRenderer in the inspector. We don't implement any of it ourselves. When you change the value in the inspector, you are actually modifying the MeshRenderer's serialized properties.
If MeshRenderer can do it, we can probably expose it in the inspector too. But if it doesn't support that, the user has to do it using their own system.
It seems that SpriteSortPoint is implemented in SpriteRenderer. So MeshRenderer don't support it, unfortunately.
Thank you for you help.
I would have expected the SortingGroup component to be able to handle this. That would have been able to control MeshRenderer's sorting as well.
Unfortunately, this functionality doesn't seem to be part of that yet either.
What was the solution for this? We are using the built in pivot point sorting in unity and custom axis XYZ 010 and it works perfect, but I was going to start toying with the idea of using Spine for a pixel art game and just ran into this "issue."
Edit: Ensuring I put the root pivot at the feet and then adding Sorting Group to the object seems to have auto allowed sorting by pivot in the draw order. Phew. Must be some sneaky code somewhere in Sorting Group that sorts by pivot automatically..
Thank you @Majicpanda, I had the same problem, spine was using center instead pivot for transparency order, and adding Sorting Group fixed that.