- Home /
What is sortingLayerID used for?
I currently use sortingLayerName but I was wondering what sortingLayerID is used for.
Since its not a string, Is it faster to use sortingLayerID to change the layer?
Thank you.
Answer by Commoble · May 26, 2017 at 02:32 AM
The Sorting Layer IDs are the integer IDs of your sorting layers; if you look at your sorting layers (in the Tags and Layers menu), you'll see that they're labeled "Layer 0", "Layer 1", "Layer 2", etc. These are the IDs of your sorting layers.
Using integers is significantly faster than using strings, yes. It's generally considered good practice to avoid using strings if you can use integers instead, since comparing strings is slower than comparing integers.
Answer by neosca · May 26, 2017 at 04:17 PM
You might want to check here:
https://forum.unity3d.com/threads/setting-renderer-sortinglayerid-serialized-property.213817/
Your answer
![](https://koobas.hobune.stream/wayback/20220612122808im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
is there any way to group sprites? - Unity2D, 1 Answer
How sort mesh renderer and sprite renderer? 1 Answer
Layers out of order can anyone help? 0 Answers
Need more flexible sorting layers 1 Answer
Sorting Order by Z-depth not accurate? 0 Answers