Sorting Layer and Order in Layer

Hello!

To start, apologies if this is covered in a future lesson. I’ve tried looking for an answer but couldn’t find one. If it is, feel free to point me toward the lesson :slight_smile:

On the setup for this new section I had an issue with the background displaying on top of any sprites that I placed in the world. I tried adjusting it on the Z axis as we did in a previous section but this didn’t work. I found the Order in Layer option and put the background at -1, because of the game objects spawning on Order Layer 0, and this worked.

I was just wondering, is this a bad idea? Is there an alternative solution?
Also, are sorting layers used to quickly assign Layer Order setups to objects?

Best,
Habit

Hi Habit,

The Order in Layer refers to the rendering order. If it’s just about sprites, not about colliders, using the Order in Layer is perfectly fine to solve your problem. :slight_smile:

If you have a complex game consisting of a foreground and background sorting layers could make sense to quickly define in which general order the sprites are supposed to get rendered, for example, sprites of the foreground should always get rendered after sprites of the background.

Please feel free to toy around with this feature to learn what it can do for you.


See also:

Thanks for the explanation! :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms