I have a character built out of multiple sprite renderers - this is out of necessity to display multiple interchangable equipped items, pants shirt shoes etc.
Normally I would custom set each of their depth values individually in order to correctly layer them however as soon as I get my character to follow a sorting map (adding or enabling the follow sorting map component), all of their layers are forced to incorrect values - mostly 0.
I assumed the "offset original order" option would maintain their relative oder, so for example a charatcer with sprites ordering 1 through 5 would be set to 11 through 15 respectively when moving into a sorting map depth of 10.
It's possible I am setting something up incorrectly, however I want to know if there is an existing solution to my problem, or if the sorting map won't support what I'm trying to do.
Comments
The included 2D Demo's player character, Brain2D, uses this trick to always display his shadow underneath him. Try dropping him into your scene to see how he works - he can be found in /Assets/AdventureCreator/2D Demo/Resources.
Set up a character with a main sprite child, and sub sprite renderers parented to that.
Set all sprite renderers to intended depth.
Attach a follow sorting map component to top level sprite renderer.
Turn on Offset original order.
Turn on Preview in Edit mode.
So far this works as intended, moving the character around the scene will update all sprite renderers with the appropriate offsets, however, now I am unable to change my original offsets.
If I turn off preview in edit mode, or disable the follow sorting map component it would seem that the initial sprite order is always restored when I turn the component or the preview in edit mode feature back on.
At this point if I want to edit my original sprite order I need to remove the component entirely, adjust my order and then re add it.
This isn't a terrible workflow, so far it is working for me, but it had me confused as I had added the component first, and then tried to establish an original order to the sprites, which would immediately be discarded and reset to the initial values.
So all in all not necessarily a bug, just a confusing aspect to the feature.