Y sorting corner tiles

Godot Version
<4.2.1>

Question

<I have this problem where I have a corner fence and it has a shadow and when I try to set the y sorting for it isn’t really possible because I have the fence and shadow on the same level when what I want to do is the character to be behind the fence but stand on the shadow->
image

So this might not be the answer you want but… you could make the shadow a separate sprite. not ideal but it would work. I’ve had to do the same thing in the past with the shadows of trees.

Something else you could do is change the shadow its self… Looking at the horizontal fence I can see the shadow is directly under the fence as if the sun is directly above. But on the vertical its as if the sun if in a different position… So you could modify the sprite so the shadow is underneath.

Also you could make the fence collision or character collision a little wider so the arm doesn’t go behind the sprite.

I always find making topdown 2D games a little harder than 3D because of these kinds of things… though there are probably alot of best practices i dont know about.

The first thing is excactly what I’m going to do, thanks for answering me

1 Like

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