I’m wanting to change the “order in layer” sorting of some sprites during an animation that I’ve set up in Unity Animation. Is this possible somehow via the animation window?
You can fix it using an animation event, calling this method
void ChangeLayer(int n)
{
this.GetComponent().sortingOrder = n;
}
I’ve been searching for this functionality as well and haven’t found anything. I’m working on this 2D character that is throwing something. After throw, the end part of his right arm that is normally in front of the character should end behind the character as he regains balance and twists his torso. So I created a copy of the same arm and set the order in layer to make it behind the character and made it invisible. Both versions of the arms, the visible and in front and the invisible and behind are parented under the same folder and I keyframe this parent folder. At the time when it should get behind, I switch the visibility of the two.