Stairs in 2D Isometric Game

Godot Version

Godot 4.4.1

Question

I want to make stairs for my 2D isometric game . I tried using 2 tilemap layers for this but this causes the player to below the other tiles on the second layer. To prevent this I set up a custom tile property so that the player’s z index would increase after using the stairs . This works but causes problems if the player goes halfway up and comes back down. Is there anyway to make it work ?
Thank You in advance

I suggest that when a character goes up or down the stairs you load them into a different scene.

that is fine for longer staircases but for a small raise in elevation it felt better to have the character loaded in the same scene. for example a staircase for elevation in the same room

Unfortunately, that is the best suggestion I can offer, at least when it comes to code. You seem to be trying to add a third dimension (height) to a 2D world. While it might be possible to do so, it raises the question as to why you aren’t creating a 3D game.

However, there is a different approach that might give you the effect you want - perspective. If you change your art asset so it appears to be higher/lower than the piece it attaches to by stairs then you don’t have to add any special code to make things work.

Hey,can you post an image of your player and your isometric stairs ?
That would help :slight_smile:

Sooo,the problem is when the player goes half way and comes back down…so you can add an area2d at the bottom point of the stair and when the area2d detects the player it would change the z index to the default.It’s a bit of complex to work with…
That’s the kind of easy way to do it.

For this would i need to manually add an area2D to every stair or can i use code to create an area2D at the bottom and top

Nope,you have to add area2d for every stair or you can make a custom node or just duplicate the stair node.first make sure it works :slight_smile:

That worked perfectly but it would be very tedious to do this for every stair manually . Is there any way to detect collisions through the tilemap or set it up so that a area2d is automatically created whenever a stair is placed

1 Like

You can make a custom node :slight_smile:
A cool tutorial on it : D

Thanks a lot

1 Like

You’re welcome : D