Forum rules - please read before posting.

Question about "Follow Sorting Map" on NPCs

This isn't really a technical issue but I'm wondering about this odd behavior in the Character wizard accessible from the Adventure Creator menu
When you use it it sets up a new GameObject with the sprite renderer as a child object which is AC's best practice but then it attaches the Follow Sorting Map script to the main object, which causes this warning to appear

he 'Follow Sorting Map' component attached to the character ' is on the character's root - depth-shifting is disabled.

-> AC debug logger
UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
AC.ACDebug:LogWarning (object,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:39)

It also causes the character to not sort properly in the scene until the component is moved to the child gameobject

I'm curious if the wizard attaches the script to the root instead of the sprite renderer for a reason and if not then I guess this doubles as a bug report.

Comments

  • This warning should only show if Also affect children? is unchecked in the component, but that option ought to be checked by default. Are you finding that this is unchecked at the moment the Wizard finishes?

  • The "Also affect children?" checkbox is checked, but the warning appears anyway and the character is not sorted correctly

    https://www.dropbox.com/scl/fi/f0c6op3zhenxc8tfoezc4/shareit-20261110-145658.png?rlkey=f2poyyur5gna7gxsjgjtreu2l&dl=0

  • Ah, yeah - this'll show if you have two characters in the same sorting region. Good spot, I'll move the component to the character's sprite-child to circumvent this, thanks.

    However, this method of sorting isn't needed any more - you can do away with manually setting sorting numbers in your Sorting Map now, if you rely on Unity's Transparency Sort Axis to handle it automatically.

    For details, see this tutorial. Once implemented, if you decide to do so, you can then uncheck the Sorting Map's Affect character sorting? option.

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.