2D noob- Sorting layers vs order in layer vs Z depthj

Having a hard time coming from 3D understanding how Unity determines rendering depth using Sorting layers vs Z depth, especially with NGUI.

Am I correct that a Sorting Layer setting overrides a Order in Layer which in turn overrides actual Z Depth setting?

ie 2 objects with same sorting layer
The one with a higher order in layer will be ‘on top of’ one with a lower order in layer?

ditto
2 objects same sorting layer and order in layer values.
The one with higher Z depth will be ‘on top of’ the other?

2 Likes

You are correct in your understanding.

Priority order:
Sorting Layer > Sorting Order > Z Position

8 Likes