top of page
Search
Writer's pictureychen3129

Animations from Maya to Unity


Overview

  • Exporting animations from Maya

  • Importing animations into Unity

  • Setting up an Animation Controller in Unity

____________________________________________________________________________


1.Export your character as an FBX file


enable your FBX plugin in Maya

Go to window>Setting/Preference> Plug-in Manager, Turn on loaded, and autoload for fbxmay.mll


Open the file with just the character rig,

In this file, we only want the Joints and the Geometry. (no control curves, no constraints)

We are not going to delete the controllers yet, since we don't want to mess up the rig. We bake the joints down to Geometry instead.


In the outliner, select all of the joints, we can do select>all by type> Joints.

Then ctrl select the Geo, do edit>Keys>BakeSimulation (Default setting should be fine)


now we can delete our controls, we would only have the Geo and Skeleton in our scene.

_______________________________________________________________________________________


Select all the joints and Geo,

use the game exporter to export the character.

Make sure

  • Select export selection,

  • if you have blend shapes set up for the character, check the blendshapes

  • uncheck the animation option box

  • choose the proper file path and name for your export

___________________________________________________________________________________

2.Exporting the animation


Open the file that contains the animation.

if it is a Cycle animation, make sure to leave out the last frame which is the same pose as the first frame.

I do like to bake everything down manually first to check everything works right in my scene.

Select the Geo and joints, go to edit> keys> Bake Simulation

Then you can delete everything except Character Mesh and joints, to keep the scene clean.



Select the Geo and Joints

Use game exporter

  • Select export selection

  • we can export multiple clips

  • choose the proper file path and name for your export


_________________________________________________________________________________________

3. Import Character and animation to Unity


Drag and drop your Character FBX into your unity project Under Assets>Character Folder

Drag and drop your Character Animation FBX into your unity project Under Assets>Animation folder


To make the animation play on the model, we need to adjust couple of things in unity.

Select your model asset,

inspector tab, Rig

Animation type: humanoid (for a biped rig)


Sometimes. the naming convention used in your Maya rig might not perfectly match the unity setting, you need to configure the rig to make sure it would work properly in Unity.

(My suggestion here would be when rigging for your character, always read the game engine document first, and try to match their naming convention as close as possible. A name matching tool would be very helpful too)


Click on the configure

Manually match the joints



All the animation assets need to be adjusted too.

For cycled animation

make sure to turn on the loop time (Inspector>animation>loop time)




_______________________________________________________________________________________

4. create animator controller in Unity


This is the step to apply all our animation to our model

Right click>Create> Animator controller

we can name it: CharacterController

Drag your animation to the controller view port

You can rename the take 001 to proper naming



In your unity scene, select the character,

Under Inspector tab> Animator

Controller plugin the Animator controller we just created.


Now you can hit play to see the animation working on your character rig.

294 views0 comments

Comentarii


bottom of page