How do I make it so that I could have a tilemap with squares adding up to a tall wall work with ysort?

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

The issue I have is that when I sort the tiles by ysort if there are multiple tiles stacked in a column the player sprite will appear above the higher up ones but below the lower down ones.

:bust_in_silhouette: Reply From: exuin

Make the wall one long tile instead of multiple small tiles stacked on top of each other.

:bust_in_silhouette: Reply From: Godotuser5675

Okay so what I did was that for each of the columns I created a script that takes the textures of the tiles, then adds a child to the y sort node that contains all of the textures in there original position then set the tiles in the tile-map to be invisible. The tile map still handles the collision but no longer the visual information.

The answer by exuin would also work but each wall of different lengths would have to be created manually.