In this lesson, you will learn how to create a hybrid animation system that seamlessly blends the reactive, data-driven nature of Motion Matching with the deterministic control of manual Animation Montages.
The Conflict: Data vs. Direction
Motion Matching is excellent for fluid locomotion, but it can struggle with specific, "authored" actions like opening a heavy vault door or performing a signature melee attack. If you rely solely on Motion Matching, you might lack the precise pose control needed for these scripted events. The solution is to use the Animation Graph as a traffic controller, prioritizing manual overrides when specific conditions are met.
The Hybrid Setup
To blend these systems, we utilize the Layered Blend per Bone or Slot nodes within your AnimGraph. By placing a Slot node after your Motion Matching node, you create a hierarchy where the manual montage takes precedence over the Motion Matching output.
- The Logic: Your Motion Matching node calculates the best pose based on the trajectory.
- The Override: When you play a Montage via
PlayMontage, theSlotnode intercepts the output, overriding the pose data from the database. - The Transition: Because we are using Inertialization (as covered in our previous lessons), the transition from the Motion Matching pose into the Montage pose will remain smooth, preventing a "popping" effect when the override triggers.
Implementation Strategy
Inside your AnimGraph, your flow should look like this:
// Logic in AnimGraph
Motion Matching (Database) -> Inertialization -> Slot (DefaultSlot) -> Output Pose
When you trigger a manual animation through Blueprints, you call PlayMontage on your AnimInstance. The Slot node detects the active montage and blends out the Motion Matching output based on the settings in your Inertialization node. Once the montage finishes, the graph automatically reverts to the Motion Matching output, ensuring your character regains their reactive locomotion flow instantly.
By prioritizing Montages in the AnimGraph sequence, you maintain the "best of both worlds": the realistic, adaptive movement of Motion Matching and the pinpoint narrative precision of manual animation.
Key Takeaway: By chaining your Motion Matching node into an Animation Slot node, you allow manual Montages to "hijack" the output pose, using Inertialization to ensure the transition remains fluid and frame-perfect.