How to use Ysort with Tilemaps in Godot 4?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By love_this_name

Hello!

I’ve been experimenting with Godot 4’s new Tilemap editor, and I’m enjoying the changes. However, I can’t get y-sorting to work how I’d like with my player and tilemap. I am aware that in Godot 4, Y Sort is now a property of any node that inherits from Node2D.

I have enabled Y Sort on the scene root Node2D that is a direct parent of both the tilemap of the player:

Scene Tree
enter image description here

I have these wall tiles on a Tilemap:

Walls and player
The red box is the player whose origin is at the bottom of the sprite.

The walls are on the same Tilemap as the green ground, but on a different Tilemap layer. Each wall tile has a YSort origin properly set:

Wall tileset y sort axes

I have Y Sort enabled on the Tilemap node itself too:

enter image description here

And yet, my player doesn’t go behind the wall tiles :confused:

enter image description here

I just want it to look like the player is in between the walls, behind the right ones and in front of the right ones. What am I missing?

:bust_in_silhouette: Reply From: love_this_name

I’m a lil silly.

There is a checkbox for each layer to enable Y Sorting. Enabling this did the trick.