Z order vs Sorting Layer

I’m not sure I see the distinction between when sorting layer should be used and when Z order should be used (obviously they’re not mutually exclusive).

Why would one choose to use sorting layer as opposed to Z depth? Just as a placeholder global constant for Z depth? Is it good practice to use one or the other exclusively?

Is it for when Z depths are the same between two sprites, deciding which to draw "on top? I don’t find the explanation at ~1:02 particularly clear. I happened to have the objects at different Z indices (not sure whether that was an accident or something I’ve forgotten doing intentionally), so I’m not sure what the benefit is to the layers.

Privacy & Terms