Tilemap : Only the bottom half is y-sorting

Godot Version 4

Question

Hi, I have a problem with my Top down 2D game :

My Y-sort isn’t Y-sorting correctly !

to be more precise, the bottom half of my tilemap has no problems but when it come to the top half, the ground is drawing above the rest.
In the image, you can see the top of a blue circle, it’s an ennemy. However the ground hide it. There is another ennemy in the bottom half which is rendering nicely.

the image :
top_half_not_good

My tilemap have 2 layers which are ground and props.
The y-sort is enable on:
-main
-TileMap
-props (layer)
-player
-ennemy

The y-sort origin of the tilset is just set for the rocks

I finally decided to remove my tilemap and create a fresh one. And it worked !

The problem was that any tiles/sprite which had a neative y value (all sprites and Tiles which were above the origin) doesn’t render correctly with y-sorting (don’t ask me why).

So if anything like that happen to you, be sure to remove all your tiles above the origin :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.