Animate sorting group?

It looks like Unity’s animation system got some special treatment for a SpriteRenderer’s Sorting Order (which it normally couldn’t animate since it’s an integer). However, as far as I can tell, the Sorting Group component didn’t get the same treatment, so it’s not possible to animate the order of those. Could this be considered for a future feature?

Do people have any decent workarounds? I guess I could create a script and call it from an event, but in my specific case I only need to change the value for the relative ordering of one SpriteRenderer and one SortingGroup, so I’m just going to animate the SpriteRenderer’s order (even though that doesn’t make as much physical sense, since it’s conceptually a stationary object).

2 Likes

I still stuck at this issue too. my sprite animation sort order is always animated sorting order to 0 I don’t know why

Also still having this problem today. Can’t animate a SortingGroup’s “Order In Layer” property. =/

I encountered the same issue today: the “Order In Layer” property of SortingGroup is not animatable.

Any explanation why it can’t be animated directly? The only thing I could do to solve the problem is to create an event in the animation and change the order by script but it seems like a pretty dirty solution to me…