+5 votes

Hi, I'm new to Godot, have been messing around with 2D isometric but am struggling with height.

In a project, I currently have three tilemaps: floor, Wall0 and Wall1. The number in the Wall tilemaps correspond to its z-index, and I was planning on having more tilemaps for higher and higher walls (with higher z-indexes).

For example, this image shows a 2 block high pillar with the player correctly drawn behind it.
height example

One problem comes in when the player changes height:
player behind z indexes

In order to get around this, I have the player change z-indexes when going up or down the slope, which solves that, but then another problem is introduced when navigating around on higher blocks:
player on higher floor

I feel like this is because the player is in the Wall0 tilemap, so they aren't sorted with Wall1 tiles. However, trying to put both wall tilemaps and the player under a YSort node ended up with more problems:
YSort node with walls and player

In the YSort node, it appears that z-indexes are ignored, so Wall1 tiles aren't drawn in front of Wall0 tiles. I tried removing the YSort node and having the player change its parent depending on what 'height' it was on, but to no avail.

I'm starting to feel like this is a terrible way to set things up. Does anyone know a better way to organise multiple 'heights' of tiles in isometric 2D such that the player can be YSorted with several tilemaps with YSort taking the z-indexes of tilemaps into account? Or if it is possible to represent multiple heights in a single tilemap?

asked Sep 22, 2019 in Engine by JellyFishCafe (17 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.