Proper Z Order for 2D in Cocos 3.X

Hello my friends,
I have a small Feature Request - Proper Z Order for 2D in Cocos 3.X
First I need to clarify that I’m not talking about 3D, but about orthographic 2D view where the node hierarchy dictates the Z Order.
I’m talking about when using Canvas-UIs in 2D scenes, there is no other way to change Z order of elements besides moving the nodes up and down of their Node hierarchy.
(unless someone has a solution, I’m fully open for it)

The most important thing, I want it to be able to work with Spines, I want to be able to move/override their Z Order on demand without moving them out of their parent Node hierarchy.

Thank you!

Maybe you can try to use multiple cameras to render in groups, and the cameras will render in groups based on the depth parameter

@daisyH, it has few problems, in orthographic view the Z order is ignored and it renders canvas objects according the node hierarchy anyway.
Can you elaborate more about setting multiple camera render groups? (hope its not affecting much the performance)
I think its not fitting my projects because its 3D, and Spine objects are limited to be in Canvas and have UI.Transform with no option to define depth.

Devs… Only if I could set the Z order for objects regardless of their node hierarchy

You can do this as shown below.

  1. Create two layers: layer1 and layer2 in “Project Settings”

  2. Create a sprite at each layer


  3. Create two orthogonal cameras and change the properties “Priority” and “Visibility”


4.Principle

Thank you for such a detailed answer! I’ll take a look into that