This blog serves as a guide for users who want to learn how to use recorded mocap data of multiple characters within the Unity engine. We break down the process of how to export a segment of a mocap recording, import the data from multiple characters in Unity, apply the data to characters and tweak the animations so they play properly in engine.
Note: If you want to use the animation shown in the tutorial, you can download them here.
Exporting From Studio
If you are looking to export only a segment of your recorded take:
Hold the Shift key and drag the scrubber on the timeline
This creates a start and end point for your segment
While still holding shift, drag the start and end points to only include the part of the recording that you want to export
Once you’re ready to export your animations, click the “Export” button to bring up the “Export options” box
Most of the default information should remain untouched however, you have the option to adjust the following settings:
If you have Virtual Production data, make sure “Export VP data” is checked
“Mimic file hierarchy” will export your files in the same hierarchy that they are in Studio
“Export Path” shows where the files will be exported out to
Default exporting file format is FBX, however, you can also change “Format” to BVH or CSV
“FBX Settings” allows you to choose between ASCII or Binary types
“Version” allows you to choose which FBX version you’d like to export as
“Skeleton” has four different choices depending upon where you plan to import the animation to: Rokoko Newton (Default), Maya HumanIK, 3ds Max Biped, and Mixamo
Once you have your settings set, click the “Export” button
Click the Unity Launcher to open the Unity program.
Open an existing or new Unity Project (if this is your first time, we recommend opening a new project)
For the sake of organization, create three new folders titled “Animations” (to house your animations), “Characters” (to house your custom characters)
Setting up FBX Files
Right-click on or within “Animations” folder and click “Import New Asset”
Locate the FBX file(s) with the recorded animations, click “Import”
Click on the newly imported FBX
In the Inspector, click the ‘Rig’ tab
If your character model contains a Humanoid rig then you need to change Animation Type to “Humanoid”
In the Inspector, click the ‘Animation’ tab
If the recorded animation is something that requires it to loop (walk, run, etc.), check the ‘Loop Time’ box.
If the length of the recorded animation needs to be adjusted, you can use the timeline to adjust the start and end times of the animation.
If the recorded animation contains root motion, the ‘Root Motion Node’ dropdown under ‘Motion’ allows you to set where on the rig the root motion is set.
If you want to preview how your animation looks on your custom character, drag and drop your custom character FBX into the window below the Inspector.
Setting up Animator
Right-click on or within “Animations” folder, highlight ‘Create’ and click “Animator Controller”
Name it whatever makes sense for you (Character1, etc.)
Drag your custom character FBX into the Scene.
Click on your custom character FBX within the Hierarchy
If it doesn’t already have it, add the ‘Animator’ Component to the FBX within the Inspector tab.
Click ‘Add Component’, type “Animator” and click “Animator” to add it.
Drag and drop your newly created Animator Controller into where it says “Controller” within the ‘Animator’ Component in your Inspector.
Open the Animator Window
Click ‘Window’ at the top of the screen, highlight ‘Animation’ and click ‘Animator’
Click on your newly created Animator Controller with the Animator window viewable
Click on the arrow to the left of the name of your FBX file to reveal the contents of it. * Drag and drop the animation clip in the Animator Window. * If you’re working with multiple animation clips and need one set to the default state for your character, simply right-click on the animation clip and click ‘Set as Layer Default State”
Testing the Animations
Click the Play button near the top of the Unity window.
If you need to make some adjustments to the position of your characters, you can move them around in your scene view
NOTE: Any changes made in the Inspector while in Play Mode will not save. So it is recommended to make your changes while out of Play Mode, then once the changes have been made, click Play to test them.
We hope this guide has helped teach you how to use recorded mocap data of multiple characters within the Unity engine. If you have issues working with the mocap data created with our Smartsuit Pro or obtained from the Motion Library, feel free to email us at firstname.lastname@example.org.