- Home /
Sorting Order by Z-depth not accurate?
Hey. So I'm making a top down 2D space game. Previously I used Orthgraphic but for lots of good reasons (mostly parallaxing capital ships in the background) I'm now using a perspective camera.
I set about getting rid of my custom SortingLayers and orders because now the Z depth could more simply render everything properly if it was all on the same Layer (Default; 0).
Problem is that seemingly at random, the rendering layers will come in wrong in the game now.
In this example, all 3 ships should appear lower than the larger ship. They're at Z of 2.5 while the larger ship is at Z of 2. Some of the fighters render below and some above. I seem to get this behaviour a lot with the elements that I have in close (but still different) Z-depths.
Is it inaccurate unless the Z difference is greater than 1 or something? I see no reason it shouldn't work. All are on Default layer, 0 depth.
Your answer
