That’s a lot of sorting groups. How many UI elements do you have?! And do you have a sorting group on every single object?
I think you might be the second person in history to hit the limit (and ask about it online), so I’m not sure what to say, other than yes, it’s probably a hard limit.
Not many at all, actually. We usually put one on the top-level object of larger UI prefabs. I did a count of active sorting groups in the scene when the error happened and it was around 40, so I suspect it has more to do with the number of renderers inside a sorting group. Number of active renderers in the scene was around 800.
Edit: this is why I’m asking if anyone has any information about this limit, because there’s literally no documentation whatsoever around it, and as far as I can tell it should not be happening.
We’ve also hit this limit. After some testing, I’ve found that a sorting group cannot contain more than 4’095 renderers and other sorting groups combined. You can create as many top-level sorting groups and renderers as you like (I tried 10’000s of groups and renderers) but each group is limited to only contain 4’095 renderers/groups.
The documentation doesn’t mention this limitation. It also never mentions that sorting order is limited to ±32’767.
Update: Disabled renderers/groups also count towards the limit.