Hi everyone! I'm currently developing a top-down game in Godot 4.4, and I'm facing an issue related to Y-sorting and the visual layering of objects in the scene — specifically how the player should appear behind or in front of environment objects like a saloon counter.
I’ve tried implementing these objects both as Sprite2D nodes and also using TileMapLayer, but the issue persists in both cases.
Here’s the problem:
When the player walks in front of an object (like a counter), everything looks correct — the player appears in front. But when the player walks behind the same object (from the top side, as you'd expect in a top-down perspective), the player still appears in front of it, instead of being visually hidden behind it.
I’ve made sure that:
All relevant nodes (player and objects) are YSort.
The YSort is enabled on the parent and relevant child nodes.
I tried adjusting pivot points and origins, but that didn’t help.
I tested using both Sprite2D and TileMapLayer setups — neither solved the issue.
Is there something I’m missing? Do I need to split environment objects into parts (e.g., a lower section and an upper section for proper layering)? Or is there a best practice for handling this kind of object overlap in a top-down game using Godot 4.4?
Any help or pointers would be really appreciated. Thanks a lot in advance!