Isometric Wall and Player layering problem

Hi, I’m looking for a logical solution or explanation for a problem I’ve been struggling with for several hours. I’m creating a survival game inspired by Sims 1, Fallout 1/2, and Project Zomboid, and I’m still learning.

I have a wall perfectly aligned to the grid, everything works fine, and it’s positioned correctly. I’ve set the pivot to the bottom right corner. However, as you might expect, the pivot adapts to the rectangular shape of the sprite, not to its isometric form. This results in an issue: approaching one side of the wall works perfectly, but when moving to the other end of the wall, the character appears behind the wall because it crosses the pivot point.

I’m attaching a video that demonstrates exactly how it looks and behaves in my project. Could anyone help me figure out the proper way to handle this?

The walls in my game are created using Tilemaps. The rest of the setup is visible in the attached video.

The video didn’t come through, you may have to upload elsewhere.


The pivot point of the wall sorts front/back against the pivot of the player.

You probably need thinner walls to get this to work how you want. So for every floor tile, you have two walls. This gives you two pivot points, for less error. They need to be thin enough to accommodate however close you’re letting the player get to the wall before the collider blocks them.

I’d place the pivots here, in PINK.

On the other hand, I’m not quite sure how Zomboid renders itself, maybe they are doing something clever. Perhaps it’s worth investigating their dev dairies and reporting back.

Actually, I was thinking last night about trying smaller walls with a 1:0.5 ratio instead of the 2:1 ratio that’s currently set. In the case of isometry, the pivot point doesn’t matter whether it’s in the bottom middle or left/right, because the object is still perceived as rectangular, and the pivot is also rectangular. Based on this rectangle, the program interprets where I am, unfortunately… I’m surprised, because the problem is ridiculously simple, and in modern game engines, there’s no straightforward solution. I spent 14 hours trying to solve it, and the only thing I came up with in the end was a wall script that would know based on the collision area whether I’m above or below it, and then dynamically manage which order sorting to choose.

When testing PZ, they also have a similar issue but on a smaller scale. When you get close to a wall, like one tile away, a small part of the body dips under the wall, which is visible but minimal. In my case, the effect is extreme.

It will probably save a lot of headache to go to 3D opaque walls so you don’t have transparent sprites as walls. That will be simple and straightforward.

Fundamentally the problem is transparent sorting which is a “never been solved, never can be solved” kind of problem.

If you’re really attached to it, another game to study is Project Hospital.

1 Like