"Stacked" square cells in my TileMapLayer

Godot Version

4.6 stable

Hello! I’m working on a 2D sidescroller project. I’m attempting to have “stacked” blocks, or appear so, in my game. I’ve googled my best and still couldn’t find anything that would help. I’ll attach an image to more clearly show what I’m trying to do. I just need the top row to appear on top of the second row of blocks.

There are a couple of ways you can do this I think. But the most readily available one is “adding another layer”
When using the TileMapLayer node and you need some sort of overlap between tiles I find it best to use multiple TileMapLayer nodes

For example the picture below is made of 4 TileMapLayey nodes

I think for your case it would make sense to have two almost identical nodes, with the exception that you second node (the one that needs to be overlapped) should have its position reduced by whatever amount of pixels the overlapped part is (if that makes sense)

When changing the position for a tilemaplayer you are changing the entire grid where the tiles are placed. So if you set the tilemaplayers position to Vector2(0,5) all placed tiles will be shifted down 5 pixels.

If you do this please remember to set the nodes z_index correct so the part that needs to be overlapped gets overlapped
Hope this helps :slight_smile:

That’s definitely a way to fix it but quickly becomes an issue for me. My scene would potentially have 100+ different rows of different blocks. As well as a mix of auto-tiles and single tile sprites. I do see what you mean, I could auto-create my 100+ rows when this scene is created but I really love how currently my system contains all the different possible blocks inside of 1 tilemap layer.

Really, I just need some kind of reverse Y-sort where cells with a higher Y position will render above objects with a lower Y position on this specific tilemap layer. Something like that.