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
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.
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.
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