Help with making my character's face change after animation

I’m currently working on a game project integrating different animations. In our game, the main character can switch between two states (let’s call them A and B) when using its powers (so if you are in the A state and use the B power, you change to the B state and vice versa). The idea is that this can be seen in its face, which changes between the A and B faces with an animation. The character has one of this faces as its default (A) so all the animations (idle, runing, jumping…) are made with this face.

I managed to make the change of face animation work with the others using the Layered Animations tutorial:

The thing is that what we want to do is that when this animations finishes playing, the current character’s face is the opposite to the previous one (if it switches from A to B, the current face has to be B and vice versa) but I don’t really know how to achieve that. Right now, when the animation ends, the face is changed again to the default one (A). I know we could duplicate the same animations we have with the opposite face but I was wondering if there is a better solution.

Most solid way is to create a new Face state machine and copy your locomotion statemachine over, then place the animations of the face (probably the same animation in every state).
And layer blend the state machine together.

less solid way is to create group slot for the face and override the face with a looping montage based on the state you are in.

For better performance, the first thing I said, but with all the animations using the different face so that multiple tracks aren’t evaluated all the time. This will however cost you memory and file size instead, so its kind of a nonsequitur…

I tried the first way and it works for me so thank you!