Sorting Layer Conflict


I am designing a topdown/isometric 2D game, that, in order to add some depth, will have the player appear on top of objects that have a greater Y position and behind objects that have a greater Y position (check image below).
To do that, I switched the Transparency Sort Mode to the Y axis and have the objects’ sprite points at their pivot, which normally gives the desired effect. However, I recently added a separate child “eyes” object to my player object and gave it a greater sorting order so that the eyes are always on top of the body.
The problem is that to create the effect mentioned earlier, the sorting layer of both objects must be the same, which means that while the body works fine, the eyes always sit on top of other objects, ruining the desired effect:

Player behind the lockers:
Player in front of the lockers:

If I change the eyes sorting layer to that of the body they don’t work properly, sometimes even disappearing.

How would you go about sorting this issue? I’m a begginer in unity so I’m a bit clueless here, thanks in advance!!

Honestly, it looks like a pretty cute effect, and I’d probably try to make it feature of the game :slight_smile:

If you want to fix it though, you can probably keep existing system you have, and just put the eye pivot slightly below the player pivot to ensure its always on top of player, but close enough to the player pivot that it’s likely to go behind other objects.