Working with 2d top-down games with different floor heights

Godot Version

4.3.rc2

Question

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

thanks, it works, the key point is the Z Index.

1 Like

how do fix this problem?

Top-floor textures cover my bottom-floor textures (shadow, player)

I mean, shadows are tricky. Like the seconds shadow should be something like this:

image

And I don’t know a way to fix that other than just making your game 3D.

Do you really have to make these extreme shadows? Cant you get away with something smaller? like this?

image

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.