I recently finished up a new component for Unity as part of a contract job with Mixamo. For those of you who are unaware, Mixamo provides an online motion capture download and retargeting service powered by HumanIK. It lets you use sliders to creatively adjust a piece of motion capture data and then automatically retarget it onto your own hierarchy and download it for use in your game. It’s really slick and pretty affordable, so it’s definitely worth checking out, particularly for any indie developers out there.
At any rate, the component that I created is designed to let animation data, rather than procedural velocity values, drive a character’s motion in space. The component sits on top of Unity’s animation API to let you simply play, crossfade, and blend animations using any of the existing API methods, and the computer takes care of everything else after the fact. The way it works is by tracking the position and rotation of the pelvis in the space of the character’s root node for each active AnimationState and then backward applying this motion to the root node itself and snapping the pelvis back into its position hovering over the root. Since the source code is all available in the project, I won’t belabor the details too much here, but you can certainly ask me if you have any questions. (The one thing perhaps worth mentioning, as an addendum to the video, is that the pelvis forward axis is not strictly necessary for computing output: only for displaying debug information. For computation, the character’s rotation is determined using the pelvis right axis.)
You can download an example project from Mixamo that contains the component as well as a sample character with some animations. Because the tutorial video on the Mixamo website is compressed pretty substantially, I have also uploaded a copy to my Vimeo account in case you would like to watch it in full HD resolution.
Tags: 3D Animation, Tools, Tutorial, Unity
[...] Mechtley demonstrates the Root Motion Computer component he created for Mixamo for use in Unity projects. The component is designed to let animation data drive a character’s motion in space as an [...]
Wow Adam, this is a very impressive bit of code you have here. I had dabbled with Mixamo before, knowing you’re helping them put out awesome tools pretty much seals the deal on where I’ll get animations when I need them. Rock on man.
Good to hear from you, David! I’ve been quite happy with the animations I’ve gotten from Mixamo so far; it’s really helped speed things up. Hope everything is going well for you and your family!
I’m late to the game in finally tracking this down but thanks for this tool! Awesome stuff!
[...] Totally awesome tool for Unity: The Root Motion Computer [...]