For some mysterious reason I can’t position one object in front of another. In 3d view it appears correctly, but during gameplay the object behind always appears in front.
A strange fact is that if I use other material for testing it works correctly. Does anyone have any tips on why this happens?
It’s to do with transparency.
Set both materials to opaque and it will work.
If you need transparency, make sure the object origins are in about the center of the object. This is because sorting object centers from front-to-back also should sort the geometry front-to-back.
To get this to work you may need to split concave objects (eg if you have a single mesh representing an entire room, z-sorting will fail from inside the room)