Using the Simple MM Controller
We provide a fast way to start using this package when no advanced configuration is needed and you wish to control Motion Matching by script. You can quickly get an animated avatar by using the SimpleMMController
script.
Example
To explore an example scene, access the Package Manager, select the Motion Matching package, and import the Examples sample. The sample scene will be located at Samples/Motion Matching/[version]/Examples/Scenes/00_Basic/ExampleSimpleMMController.unity
.
Getting Started:
- Import the Samples: Import the package's example samples through the Package Manager.
-
Add the Prefab: Drag and drop the
Samples/Motion Matching/[version]/Examples/Assets/Prefabs/SimpleMMController
prefab into your scene.This prefab contains the following components on its GameObjects:
- Root GameObject:
SimpleMMController
script (the main interface for controlling the character). - Child GameObjects: Contain a
CharacterController
, aMotionMatchingController
, and the animated avatar.
- Root GameObject:
-
Script Interaction: Obtain a reference to the
SimpleMMController
script from your custom script. - Control Velocity: Use the
SetVelocity(Vector2 velocity)
public function to set the desired direction and speed of the avatar's movement. TheVector2
input represents the velocity in the horizontal plane (X and Z axes).