❓How does it work?
In this section we will learn how the system achieves such a nice blending.
Background
Usually, Unity developers use techniques such as Layering and Additive Animation to blend motions on the fly. However, this does not always work great, because animations are always applied in local space.
Tip: local space means relative to the parent transform.
Example: if we override the character sprinting animation with a static upper body pose, it will look horrible - the body will be moving around as if it was attached to the pelvis.
Imagine how complex your animator controller will be with all the different control parameters and animations. This big and convoluted structure will be difficult to maintain, and most importantly scale in the future.
Overview
Magic Blend takes a different approach - it operates in character root bone space. Why does it matter? As mentioned above, the local space rotation overrides do not always look good. While it will work for fingers and arms, it does not work for the lower body or spine.
Tip: root bone space means we will apply rotation and translation relative to the character root bone (Root or Armature).
On top of that, Magic Blend offers an easy way to adjust sliders on the fly and separate your poses from the animator controller. That's where the scalability kicks in - want to add a new weapon or item? Sure, no need to modify your animator controller, create a Magic Blend Asset and you are good to go.
Not even to mention the smooth blending between different poses - Mecanim Animator does not provide anything compared to that.
On the low level
The Magic Blend updates your character animation pose via these 3 main stages:
Copy base animation pose. Such a pose is usually an idle, used as a reference frame to compute dynamic additive data.
Copy overlay animation pose. This is your weapon or item pose. The system will copy its transforms in global space to blend in the final step.
Compute the dynamic additive between the locomotion pose (coming from your animator) and the base pose from the first step. Then, apply that additive result to the overlay pose. Finally, blend between additive overlay and current animator pose.
The system is powered by Animation Jobs, so it stays performant even when there are a lot of characters running around in the scene.
Last updated