Overlapping Corners Problem

I’ve been trying to rebuild part of a fairly simple GBA game for the sake of learning the basics of Unity but I came to an halt pretty early since I can’t really figure out this fake 3D effect. When I approach the corner of a wall I am supposed to be hidden behind the wall but only partly. I created this video since I can’t describe my problem all that well. peskylightintermediateegret I tried tinkering with layers but it doesn’t seem feasible.

So you need to sort the sprites orders by their Y positions. The easiest way of doing this is to go to Project Settings → Graphics → Camera Settings → Transparency Sort Mode and setting that to Custom Axis with X and Z being 0, and Y being 1.

Make sure the pivot of each sprite is where you want them being sorted by. So for example, if you want the character to pass behind a wall when passing its bottom edge, the pivot of the wall needs to be at the bottom edge. You can change the pivot of a sprite in the Sprite Editor of that sprite’s inspector.

2 Likes

Thank you for your reply but I tried your method and it’s still not really working. So I went ahead and just made this part not accessible by foot. But I found out a couple of seconds later that this won’t fix my problem since I can’t just block everything off. This one partis just too narrow so I need to go behind the wall. That’s how it looks:

Okay, now I found out what the problem was. The order of both layers needs to be the same otherwise the pivot settings do nothing.

1 Like