Top-down walk in front of/behind objects

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

In my project I’m trying to have a perspective similar to 2D Zelda or Final Fight–as in, top-down but slanted. As a result, I’d like to display certain objects so that when the player walks in FRONT of it, the player overlaps, but when the player walks BEHIND it, the object overlaps the player (normal perspective stuff). Is this difficult to pull of, and how do I do it?

Example of what I mean.

Thank you in advance!

:bust_in_silhouette: Reply From: kidscancode

This is called “y-sorting” and can be done using this node: YSort — Godot Engine (3.1) documentation in English

Essentially it draws objects in order of their y coordinate value.