Ysort on Tilemap does'nt works

Godot Version



Ysort doesn’t work in my tilemap, but I have already been setting ysort origin, enabling ysort on the player and on the tilemap concerned layer.
Can somebody help me to find the problem?

Y-sort in tilemaps can be confusing as hell :smiley:

See, here I have a 2-high tile, your tree is probably something like this too

The point along which y-sort determines if the object should be behind or in front of others is called Y-sort origin. You can find it in the Paint menu, set the value to what seems good and then paint the value onto your tree tiles. The spear in my case.

Screenshot 2024-06-06 at 21.13.48

You can see the little orange origin sign all the way to the bottom. I shifted it 48 pixels down.

Another thing that plays into how your character is y-sorted is its own origin. Try to have the origin of your character roughly where the feet of his character is. Like this:

Screenshot 2024-06-06 at 21.16.38

The actual position of the sprite is higher than the CharacterBody2D exactly for these Y-sorting reasons

Thank you but I already made it, but it doesn’t work!

Pls say me if I did something wrong