Hi
I’m working on a top-down game with different floor heights
I’m using TileMapLayer and y sort origin to change player floor
the problem comes when I have other objects as well
Floor 1:
Floor 2:
as you can see, I have 2 boxes, one in floor 1, one in floor 2, when I in floor 1, box on floor 2 was not visible because of y sorting, and when I in floor 2 both boxes were shown in floor 2 because of y sorting.
Do you have any ideas for better floor management?
You could probably use Z-Index as floors. Whoever’s on floor 2 (z-index=2) will always be shown in front of anything that’s on floor 1 (z-index=1) .
Somehow you’ll have to manage the player changing Z-indexes when it goes from floor to floor.
That, combined with ysorting of course (for objects within the same floor, ysorting will apply).