There is a recent requirement that characters in cutscenes be superimposed with emojis while playing other actions, and that emojis be superimposed independently in case other functions are called in the blueprint or CPP.

First, we need to make the function of playing emoticons independent, and define two fields in the animation state machine:

Indicate whether to play emoticons and which emoticons to play. Remember to add Interp so that the two fields can be found in the Sequence.

Next, open the Animation state machine for the character and add Animation Layers:

The BaseLayer is a character’s main action state machine (walking, running, jumping, etc.), the FaceLayer is responsible for animation of expressions, and the LayerBlending theory blends other layers.

Let’s take a look at the FaceLayer layer:

The additive after the animation name means that the animation is a stacking animation. If you don’t have the additive word, you need to change AdditiveAnimType to Local Space in the animation file. This allows the matrix data to be superimposed on the character when mixing the animation.

Then there’s the contents of the LayerBlending layer:

Again, this will act as a switch for the emoticon animation based on the Boolean defined above for bPlayingEmotion. When the switch is on, the character will play the basic action plus the emoticon animation, and when the switch is off, the character will play only the basic action. BaseLayerInput is the result of a BaseLayer, and FaceLayerInput is the result of a FaceLayer.

Overlay Animation also needs to be connected under the operation of Animation Layers:

Now that the overlay animation is complete, you can set the bPlayingEmotion field in the blueprint or CPP to play/not play the emotionEmotion. You can set the EmotionType field to determine which EmotionType to play.

Finally, how to configure the Sequence to use the superimposed emoticons function, as shown in the figure below:

By modifying the values of the two fields in the timeline, you can control the BP_xxx model to play casual action while superimposing facial animation, and preview it in the Cinematic Port editor (the event track mode cannot be preview in the editor).

According to the principle, art students can directly play the casual actions with expressions and then use Animation track to play them directly. However, walking, running, jumping and other actions require a huge amount of work independently. Therefore, if the project contains many cutscenes with expressions, this scheme can be considered.