Y-sorting problem

Godot Version

4.7.2-stable

Question

I have a bit of a problem with Y-sorting where I think it doesn’t work when the Y of the player and the Y of the wall matches. Basically, I want to prioritize the wall here and render the player behind.

Expected:

Result (when I go to the edge):

I can’t use Z-index either because I still want to retain this feature:

Just move the player above the TileMapLayer in the scene tree, this has a similar effect to z-index but with lower priority than y-sort.

(possible in the editor or at runtime with Node.move_child(...))

That didn’t work unfortunately or I did not understood what you said. The result seems to be the same anyways.

This is my setup currently to give more context. The walls are in the object layer and both the GameRoot and the layers have Y-sort enabled.