Problem displaying 2D sprites on multiple layers

Hi all, i’m new to Unity and trying to build a 2D map but i’m having some trouble setting the correct order…
I thought that using Z as layer would have make unity draw the sprites with the correct overlapping but it doesn’t seem to work in some places…

In the editor window you can see that i set the sprites so that those which need to be drawn on top have lower Z, instead those which can be overlapped have higher Z.
You can also see that the wall is being drawn over a sprite with lower Z (why is that?!)

I’d like to know what i’m doing wrong and how to fix this, thanks!
(Camera is in ortographic mode)

Edit: i’m using Sprites/Default shader

19328-03.png

I too was having this issue and found that it was being caused by the Material on the Sprite Renderer. I had some which where “Sprites-Default” and others which were “Default-Diffuse”. Setting them all to the same fixed the issue for me.

I hope this helps.

I had this problem with some 2d characters which I was animating within unity. Having the head stay on top of the chest, whilst being correct in relation to other characters, was a huge headache.

I used a multiple Z as the render layer and had them all stay in relation to the chest. So chest layer = chest.z. Head layer = Chest Layer +1. This kind of worked, but it was inconsistent and would swap around whenever I moved.

Anyway, it was solved after many lost hairs by swapping around the ‘fixed update/update’. I think I had the chest calculate on Update but the other parts that relied on it coming in the fixed update. Hope this helps someone.