Godot Version
4.4.1
Question
Hi everyone,
I’m working on a top-down game in Godot (like classic Tibia) and struggling with proper Y-sorting between TileMapLayer-based walls (built from multiple tiles) and characters like the player and monsters (which are outside the TileMap, in Node2D groups like Characters).
I’m trying to achieve a natural overlap where characters can walk behind and in front of tall wall tiles (e.g., 2x1 or 1x2 tilesets), depending on their Y position — essentially needing both X and Y consideration for sorting.
I’ve tried:
- Splitting wall textures into more parts on different layers
- Changing the Y-sort origin on the tiles themselves
- Scanning forums/docs/tutorials — but each method breaks under certain conditions (e.g., corners, diagonal overlaps, or adjacent walls)
Is there a robust way to handle sorting between TileMapLayer-based objects and Node2D characters?
Ideally, a solution where characters properly sort behind/in front of wall assets, especially when those assets are built from multiple tiles and have offset origins (e.g. 16x16).
I’m thinking about something that works like or mimiks behaviour of same urgen x and y sort.
Till this point i’m pretty much sure there is no clean and easy solution for this because Godot draws tilemaplayers in whole rows and then the character on the same exact y-pos but lower x-pos is displayed over the tiles tiles that should cover him.
I belive that there is no such option to turn on that godot looks the same x and y axis to sort by but i hope that someone, somewhere in this world had similar problem and could fix it without writing own engine or whole huge plugin to godot
If anyone has faced a similar issue — or has a creative workaround — I’d really appreciate your insight!
example problem which is easy to fix but then it breaks somewhere else.