You've successfully subscribed to Hacking with Unity - Learn how to create your own games
Great! Next, complete checkout for full access to Hacking with Unity - Learn how to create your own games
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.

Sorting Layers vs Layers

Ben Liu
Ben Liu

Sorting layer and layer are two concepts which are frequently seen in the Unity.

TL;DR

Sorting layer only affect the visible layers in the game.

Layer affect the contacts and collision.


Sorting Layers

Sorting layers can be added through inspector, select the layers from top tool:

Then click Edit Layers:

for sorting layers, the layer is more on the top, if the value is more bottom in the list.

Layers

For Layers, they are related with contact and collision. The sorting of the layers doesn't matter how the objects are seen by the camera. And you can setup which layers can be collided and which are not in the project setting:


Conclusion

Sorting layer only affects how the camera see the game objects.

Layer affect the contacts and collision.

Ben Liu

Please feel free to contact me if you have any question. <br> https://t.me/NeedoneApp