Getting Started
This guide will walk you through installing Motion Matching for Unity (MxM) and setting up your first motion matching character.
Requirements
Unity Version
- Minimum: Unity 2020.3 LTS
- Recommended: Unity 2022.3 LTS or newer
- Tested: Unity 2022.3+, Unity 6
Unity 2022+ Compatibility
This community fork has been updated for Unity 2022+ compatibility. If you encounter issues with newer Unity versions, please report them on GitHub.
Dependencies
MxM integrates with Unity's built-in systems:
- Unity Animation System (Mecanim)
- Unity Physics (for trajectory prediction)
- .NET Standard 2.1 or newer
Project Requirements
- Animation clips - Humanoid or generic animated characters
- Recommended: Motion capture data for best results
- Storage: Motion databases can be large (100MB+ for full character sets)
Installation
Option 1: Install via Git URL (Recommended)
- Open your Unity project
- Go to Window > Package Manager
- Click the + button in the top-left corner
- Select Add package from git URL
- Enter the following URL:
- Click Add
- Unity will download and install MxM
Keep Updated
To update to the latest version, simply remove and re-add the package using the same Git URL.
Option 2: Manual Installation
- Download or clone this repository:
-
Copy the
MxMfolder to your Unity project'sAssetsdirectory -
Unity will automatically import the package
Option 3: Unity Package Manager (Local)
- Clone this repository to your local machine
- In Unity, open Window > Package Manager
- Click + > Add package from disk
- Navigate to the cloned repository
- Select the
package.jsonfile (if available)
Verifying Installation
After installation, verify MxM is working:
- Check the MxM menu: You should see MxM in the Unity menu bar
- Check for components: Search for "MxM" in the Add Component menu
- Open example scenes: If included, navigate to
MxM/Examplesto see demo scenes
Project Setup
Step 1: Prepare Your Character
MxM works with humanoid or generic animated characters. You'll need:
- Character model with a rig
- Animation clips (minimum 10-20 clips recommended)
- Animator Controller (can be basic or empty)
Animation Requirements
For a basic locomotion setup, you'll need:
- Idle animations (1-2 clips)
- Walk cycle (multiple directions if possible)
- Run cycle (multiple directions if possible)
- Turn animations (optional but recommended)
- Start/stop animations (optional but recommended)
Step 2: Create an MxM Animator
- Select your character in the Hierarchy
- Add the MxMAnimator component:
- Click Add Component
- Search for "MxMAnimator"
-
Click to add
-
Configure the component:
- Assign your Animator reference
- Set the Update Mode (typically "Normal")
- Configure Trajectory settings
Step 3: Create an Anim Data Asset
The Anim Data asset is the heart of MxM - it stores your processed animation database.
- Create the asset:
- Right-click in Project window
- Create > MxM > Anim Data
-
Name it (e.g., "CharacterAnimData")
-
Add animation clips:
- Select your Anim Data asset
- In the Inspector, click "Add Clips"
-
Select all your animation clips
-
Configure poses:
- Set Pose Interval (default: 0.1s works well)
- Configure Trajectory Points for prediction
-
Set Joint Weights (hands, feet usually higher priority)
-
Process the data:
- Click "Pre-Process"
- Wait for the process to complete (can take several minutes)
- A progress bar will show status
Processing Time
Pre-processing can take 5-30 minutes depending on:
- Number of animation clips
- Length of animations
- Pose interval settings
- Your computer's performance
Step 4: Assign Anim Data to MxMAnimator
- Select your character in the Hierarchy
- Find the MxMAnimator component
- Drag your processed Anim Data asset to the Anim Data field
Step 5: Set Up Input & Trajectory
MxM needs to know where your character wants to go:
- Create an Input Profile:
- Right-click in Project window
- Create > MxM > Input Profile
-
Configure input bindings (WASD, gamepad, etc.)
-
Assign to MxMAnimator:
- Drag the Input Profile to the MxMAnimator
-
Configure Trajectory Generator settings
-
Test movement:
- Enter Play mode
- Use input to move your character
- MxM should select appropriate animations automatically
Unity 2022+ Migration Notes
If you're upgrading a project from an older Unity version:
Breaking Changes
- API Updates: Some deprecated Unity APIs have been updated
- Serialization: Re-process your Anim Data assets after upgrading
- Physics: Trajectory prediction may need recalibration
Recommended Steps
- Backup your project before upgrading Unity
- Upgrade Unity to 2022.3 LTS or newer
- Re-import MxM from this fork
- Re-process all Anim Data assets
- Test thoroughly in Play mode
- Recalibrate trajectory and timing settings if needed
Troubleshooting
"MxMAnimator not found"
- Ensure the package is installed correctly
- Check for compilation errors in the Console
- Try reimporting the package
"No valid pose found"
- Check that Anim Data is assigned to MxMAnimator
- Verify Anim Data has been pre-processed
- Ensure animation clips are compatible with your character rig
Performance Issues
- Reduce Pose Interval (larger intervals = fewer poses = faster)
- Decrease Trajectory Points
- Lower Search Budget in MxMAnimator settings
- Use LOD system for distant characters
Animations Look Jerky
- Decrease Pose Interval (more poses = smoother)
- Increase Blend Time in MxMAnimator
- Check that Update Mode is set appropriately
- Verify Frame Rate of source animations
Next Steps
Now that MxM is installed and set up:
- Explore the examples (if included in the package)
- Read the Technical Reference for deep understanding
- Check the Original PDFs for detailed workflows
- Experiment with different settings and animation sets
- Join the community and share your results!
Additional Resources
- GitHub Repository: Frost-Blade-Studios/Motion-Matching-for-Unity
- Report Issues: GitHub Issues
- Community Discussions: GitHub Discussions
Ready to Go!
Your MxM setup is complete! Try creating a simple character with basic locomotion animations to see motion matching in action.