How can I properly sort paperzd flipbooks on an actor and sort that actor against sprites in the world properly?

Vrtual
Thu, 23 Jan 2025 23:13:31 +0000
Rendering

Hello all, I have been working on a 2D RPG-View / Top Down style project and I’m facing some difficulties I’m hoping someone here can help me with:

I have a PaperZD Character which I’m setting up to have multiple layers (0 Base for the skin, 1 for the Outfit and another layer for the Hat, I will have more layers if I get this working). The way I’m approaching this issue is by creating multiple Paper Flipbook components on the Character and I was hoping to sort them either by TranslucentUnlitSpriteMaterial and using the “Sort by Distance” rule in the Project Settings or by using the Sort Priority. Now I have one big problem, since this is a top down game, I want to be able to walk behind trees, houses, etc. For that I need to adjust the pivot on the Player Sprites and Environment Sprites to “Bottom Center” and in the Project Settings select the “Translucent Sort Policy: Sort Along Axis” (and use (X=0.f,Y=-1.f,Z=0.f) for the sorting).
Doing that breaks my plans on having sorting on the character layers since I can’t sort them anymore by distance (the Sort policy in the Project Settings cannot be overridden inside my character). Also if I use the Sort Priority I draw those components completely on another layer and the sorting policy won’t count them since they are not in the same layer as the environment sprites anymore (so those layers for my character won’t get behind the environment).

So the question is, how can I sort the flipbook components inside my paperzd character to have a character composed by several layers and at the same time be able to sort the character in the level against other sprites using the “Translucent Sort Policy: Sort Along Axis” to be able to get behind actors placed in the level?

Any help is very much appreciated!