Forum rules - please read before posting.

Character with multiple sprite renderers - broken when following sorting map?

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

  • edited March 2018
    I tried adding a sorting group which almost worked, but still had some unexpected results, for the most part my layers were offsetting together properly, but one or two of the sprite renderers would be set completely incorrectly. 
  • The "Offset original order?" option should indeed work as you assume.  You haven't said in what way the sprites break, however.  What exactly is happening when you use this?  Bear in mind that you should only have one FollowSortingMap on your main sprite child - the other sprites shouldn't have one.

    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.
  • edited March 2018
    I think it was a workflow issue, it's a bit hard to explain but I'll describe reproduction steps:

    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.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.