In this lesson, you will learn how to attach metadata tags to your animation clips to refine your Motion Matching database and ensure the system selects only contextually appropriate poses.
Why Use Metadata Tags?
When you build a large animation database for Motion Matching, the engine essentially performs a high-speed search for the "best" pose based on your character’s trajectory. However, the engine doesn’t inherently know that a "crouched walk" shouldn't be used while your character is standing, or that a "waving" animation shouldn't be selected during a high-intensity combat run.
By applying Data Tags (often found within the Motion Matching or Pose Search database settings), you categorize your animations. This acts as a filter: when your character enters a specific state, you tell the database to only look for animations marked with a corresponding tag.
Applying and Filtering Metadata
Inside your Animation Database Asset, you can define custom tags for each sequence. For example, you might create tags like Locomotion_Idle, Combat_Walk, or Stealth_Crouch.
When the Pose Search system runs, you can provide an Evaluation Context that specifies which tags are currently active. If the character is in a "Stealth" state, the system will ignore any clips that aren't tagged with Stealth.
In your Animation Blueprint, you might handle this logic by updating a variable that informs the database:
// Pseudocode concept for filtering a search
// This ensures the database only considers poses valid for the current gameplay state
Database->SetFilterTags(CurrentGameplayTags);
Preventing Inappropriate Poses
Without tags, the motion matcher might find a "perfect" match geometrically that looks completely wrong narratively—like playing a "happy stroll" animation while the character is holding a heavy weapon. By tagging your assets, you prevent these "illegal" transitions before the engine even considers them. This keeps your motion matching fluid, performant, and logically sound, as the database is forced to ignore irrelevant data that would otherwise break immersion.
Key Takeaway: Use Animation Data Tags to act as semantic guardrails for your database, ensuring the Motion Matching system only selects poses that are contextually valid for your current gameplay state.