Problem with the rendering order of sprites

Hi, I’m creating a 3D world with objects and characters made of 2D sprites and I’m having a problem with the rendering order.
These 2D objects are made of several sprites orderered via the Order in Layer and the Sorting Layer, which let me animate an object by moving/rotating/showing/hiding its parts; for example the placeholder of the player, which you can see below in the picture below, is made of three sprites (head, torso and legs) which are ordered via the Order in Layer: the head is on the top level (n°3), the torso on the lower level (n°2) and the legs are on the lowest level (n°1). All these parts belong to a “Sorting Layer” called Player, this way the head is in front of the torso and the torso is in front of the legs:

Sorting Layer: Player
Level 0-: nothing here
Level 1: legs
Level 2: torso
Level 3: head
Level 4+: nothing here

If I wanted to animate the placeholder, I could rotate the sprite of the head, or move it up and down, etc.

In the picture below you can see a lightblue rock, which I can’t put on the same levels as the player, otherwise one would always be in front of/behind the other one. If I put the rock on Level 0 or lower, it would always be behind the legs/torso/head; If I put it on Level 4 or higher, it would always be in front of the legs/torso/head. And obviously I can’t put the rock on level 1-3, otherwise it would hide some parts of the player while showing others.

I thought I could simply use a different Sorting Layer, called “Rocks” for example, and let the Z rendering do the ordering/render, but this is not the case because the Sorting Layer works exactly like the Order in Layer…if I set the level of the layer “Rocks” above the level of the layer “Player”, the rock would always be behind the placeholder of the player, and viceversa if I put the layer “Rocks” below the layer “Player” it would always be in front of it.

The picture shows the problem, the placeholder of the player is behind the lightblue rock in the 3D world space, although it is rendered in front of it because the Z rendering is overwritten by the order of the Sorting Layer.
I need a way to order the parts/sprites which belong to a single object (for example head, torso, arms and legs of a character or branches and trunk of a tree), letting every object have its own layer order and at the same time keep every object on a common layer level, letting the Z rendering do the render/order based on the position of the objects in the 3D space. Hope it makes sense…

The only solution I see is to use a sprite atlas where every sprite is a keyframe of a whole object; instead I want the sprites of the atlas to be the parts of the object and animate tit by moving/rotating/showing/hiding these parts.

Any idea? Thanks :slight_smile:

Anyone pls? I’m really stuck :frowning:

I tried to use the Z axis to sort the layers of the parts of the body and it doesn’t work.

Is there a way to order the sprites of an object independently from other objects in the scene?

Here there’s an example at 2:10

The character and the grass in the video are made of several pieces and the character can move behind and in fron of the grass without problem.