Image depth in isometric 2D game

Hi, I am currently working on building a 2D isometric game with Unity, and I have done rendering a tiled map with objects (buildings, trees) on it. And by setting Z value of objects I am able to decide which object is behind another one. Currently I am setting the Z value of an object equal to -(y-x), and that works for 1x1 objects like 1x1 stones. But in the case of objects with other sizes than 1x1, it’s not working. In attachments you may discover that when my character walk to to right part of the NxN object, it was rendered behind the object (walking to the left part is also broken). How can this be resolved? Many thanks.

It might be easier to approach it from a different angle.
Have your main camera at a rotation of x:30 y:45 z:0
Place your floor tiles along the world plane in unity.
Have any sprites such as trees at a rotation of x:30 y:45 z:0
You can then move all your sprites around in world space ( x and z ) and let unity handle the depth ( as its in 3D space ) although this only works for worlds with a flat floor :slight_smile: