Y Axis sprite ordering while a child in a group?

So I have my game set up to use an empty object in the hierarchy to “house” 4 characters for a party.
9521623--1343164--upload_2023-12-10_21-22-16.png

They follow each other while the game is running. I set the pivots in each sprite of every animation, and set the URP setting as so.
9521623--1343167--upload_2023-12-10_21-24-32.png

However I still get one guy standing on another’s head.
9521623--1343170--upload_2023-12-10_21-25-37.png

If I am understanding what I read in a couple other threads correctly, this is happening because the sprites are in the parent object “Party” and so the engine is ignoring the pivot sorting and defaulting to the parent’s selection. Is there a way to correct this without having to tear down everything and start my party system anew? I tried putting a sprite renderer in party and changing it to pivot, but that did not work.

no, theres some other problem, a parent object is not supposed to hijack the sort order unless it has a sorting group component

2 Likes

yeah there is some other problem going on, try one of these:

  • “renderer 2d data” is assigned to the “Universal Render Pipeline Asset”

  • “Universal Render Pipeline Asset” is assigned as the active SRP setting in the Project Settings>Graphics

  • All the character sprites have their pivot set to somewhere near the feet

  • All of the characters have “sprite sort point: pivot” selected in the sprite renderer

  • All the character sprites have the same sorting layer and order in layer in the sprite renderer

  • Make sure up vector is really the +y direction(if you select a gameobject and press w, green arrow will point to the top and red arrow to the right)

1 Like

Ah, I see I misunderstood what I was reading. I will try your suggestions as soon as I can and let you know the results.

Something else I just thought of that is honestly quite likely the cause, just putting this out there for record. I recall when I started this particular project I started it in 2D core. Early on however, I followed Unity’s instructions on changing it to 2D URP (link below).

https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.1/manual/InstallURPIntoAProject.html

It was #2 of your recommendations that solved this issue for me. A simple rookie mistake I am sure, but I am a rookie. I could have sworn I did that when I changed over, as the instructions CLEARLY state to do so, but I must have missed a step.

Thank you all so much for the assistance!

1 Like