Top Down 2d game: How to create 'depth'

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

I am trying to make a 2D top-down game (like Zelda: A link to the past) but I am struggling to find a good way to create depth .

By depth I mean that the player can be both partially behind and in front of another sprite. So, for example, that the player could be behind a block and be partially covered by it; and that he could be partially cover the statue if he is in front of it. Somehow the picture doesn’t seem to work on this post, so I uploaded an example picture here: Imgur: The magic of the Internet That probably explains the problem much better.

I know that I can use multiple nodes with sprites, but that feels really inefficient. Is there a better way?

:bust_in_silhouette: Reply From: 1izNoob

Nevermind, I found the answer myself. If someone happens to encounter the same problem:

The YSort Node solves that problem beautifully. Here is a nice tutorial on it:

Was looking for this. Thanks. Knew that it would have to do with this but had multiple problems I thought it would lead to.

Gazi Safin | 2022-12-26 08:11