- Home /
How to animate character and weapon together in Unity?
I'm trying to get a fully animated character from Maya into Unity, but I can only either get the character to animate or his sword to animate, but never both. I've tried the following things:
Exporting to FBX - the sword animates just fine, but the character does not move at all and the "Bake Animations" box is greyed out, so I can't select it.
Exporting to MB - the modeler who made the character uses Maya 2013 and I only have Maya 2012, so I can't see his files and Unity can't load them (Unity times out after 3 minutes, leaving me with a corrupted file).
Exporting to MA - I removed the -ch #### line in a text editor to allow forwards compatibility. This allowed me to bake his animations and got him to move, but his sword is completely absent. It clearly exists in the .ma file, but is non-existent in Unity's hierarchy.
Parenting the joint to the sword - I brought the sword in as a separate object, attaching it to the .ma file from above, and parented the joint closest to where the character holds it. The sword properly animates, along with the character, but I cannot get the sword to properly be centered on the joint. It is always moving in midair away from his hand no matter where I put it. I want to avoid using this method because it's incredibly messy and I don't want to have to do that for 10+ future characters.
Both the modeler and I are completely stumped, and I can't find anyone else having the same issue.
Any ideas?
Answer by AmISam · Mar 02, 2014 at 01:20 AM
I figured it out. All I had to do was bake the animations in Maya instead of Unity and then export it as an .fbx.
The major problem was the 3D modeler was using Maya 2013 while I was using Maya 2012. When trying to forwards-compatible the files from 2013 to 2012, information gets lost, which is why the option to bake animations in Unity is greyed out and the sword disappears. This is why you import the files as fbx's and not as ma's or mb's, because ma's and mb's will only force Unity to open Maya and convert them to fbx's anyways, and if the file is not compatible with your version of Maya there will be problems. By exporting it as an fbx in Maya, you have more control over how you want to import it into Unity, and it won't bother opening Maya to convert it to fbx because it is already an fbx.
I've heard people say not to bake animations in Maya, but so far I haven't encountered any problems with it, so it's hard to say at this point whether it's just an unfounded concern or if it'll actually cause problems in the future.
Hopefully this is helpful to anyone else having a similar problem.
Your answer
![](https://koobas.hobune.stream/wayback/20220613134937im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Walk animation 0 Answers
character & objects import in different scale & animation dosent work right anymor!!!! 1 Answer
Unity won't animate Maya Model 1 Answer
A node in a childnode? 1 Answer