Y Sort not working at all

v4.2.1.stable.official [b09f793f5]

I’m having a problem where I cannot get Y Sort to work at all. I have a tree scene (StaticBody2D) and a player scene (CharacterBody2D). They both have Y Sort Enabled and their node’s y-coordinate is centered near the bottom.
edit The parent node (Node2D) has Y Sort enabled as well. /edit
But Y Sort is not working, and I’m out of things to try.
edit I’ve tried making the parent scene(Node2D) have Y Sort enabled while the other two nodes do not have Y Sort enabled. That did not work. /edit
Final edit The problem was that I had the Z index set to 1. I reset it to zero and Y Sorting started working again.
I appreciate the help I was given. Thank you mrcdk.

You need to enable y-sort in the parent node where you instantiate those scenes. Unless you need y-sort in the children of the tree or player scenes, you don’t need to enable y-sort there

  • Level (Node2D) y-sort
    • Tree
    • Player
1 Like

Thanks for the help. Unfortunately, the parent node (Node2D) has y-sort enabled as well.

1 Like

Thanks for the help. I tried this, turning off Y Sort on everything but the parent node. I wish it was the solution to my problem. I was really hoping that it would solve everything. It did not change anything.

Any luck with this issue? I have a similar problem but with 2 CharacterBodies not y-sorting.

1 Like

For me, their z-index was changed, keeping the player in front of the trees.