Community
Maya Animation and Rigging
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya animation topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Animation Not Working In Unity

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
Anonymous
28610 Views, 19 Replies

Animation Not Working In Unity

I don't know what's going on. I've created a few characters in Unity using the same workflow and their animations work fine.

However, with the newest character, I can't get the animations to work in Unity.

 

The problem is not the animation files themselves - I used one of the other humanoid characters to test the animations and they working fine.

 

The only thing I have on the prefab (right now since I deleted everything else) is the Animator (they're legacy animations). Set to the run animation to test.

Like I said - the animations are working. They're set to Legacy, they're looping, etc...

 

So the problem must lie with the model withe the skeleton. The only thing I can think of is that my settings are bad - I don't remember which settings I used to export the other models. Here are my settings:

 

 image.png

image.png

 

Right now they're pretty much random. I've tried many different combinations of settings trying to get the animations to work. I've spent hours pulling my hair out over this, please help.

19 REPLIES 19
Message 2 of 20
kirbysteele
in reply to: Anonymous

Hey jeungwi,

 

This sounds like a unity and not a maya problem. 

 

If you have set your animation import setting on your character to legacy, you can't use an animator component with them. Legacy animations use the animation component and are not retargetable, meaning they are contained to the model they were imported on. The other two import settings generic and humanoid both use the animator component, but only the humanoid option allows you two share animations between different models. 

 

If you want all your characters to share animations then they all need to be humunoid animation type. Keep in mind that only animation on the main skeleton is totally transferable (hips, knees, elbows etc.) so if you have a face or tail or whatever, then those bones are not retargetable. 

 

This is a good post about that. https://blogs.unity3d.com/2014/05/26/mecanim-humanoids/

 

Hope this helps.

 

 

Message 3 of 20
sean.heasley
in reply to: kirbysteele

Hi @Anonymous

 

I'm just checking in to see if you need more help with this. Did the information that @kirbysteele provided help you at all?

If so, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

Message 4 of 20
Anonymous
in reply to: sean.heasley

@sean.heasley @kirbysteele Sorry, I must have gotten them mixed up when I wrote the post but I'm using the correct component that's supposed to work with Legacy animations, not the new one. The models are set as humanoid rigs and the animations are legacy. The animations are separate files.

Message 5 of 20
sean.heasley
in reply to: Anonymous

Hi @Anonymous

 

This does seem like a Unity issue more so than a Maya issue. Out of curiosity, you said that the workflow worked fine on your previous models but now the issue is occurring. Is it possibly you updated Unity or changed something that may be affecting the animations?

 

Let me know if anything changes!

Message 6 of 20
sean.heasley
in reply to: sean.heasley

Hi @Anonymous

 

I'm just checking in again to see if you need more help with this. Did you get to check and see if you updated Unity or changed something that may be affecting the animations?

If your issue is resolved, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

Message 7 of 20
Anonymous
in reply to: sean.heasley

Yeah, sorry I got stuck in Midterm hell for a few weeks. I did not update Unity since working on the other characters - I've been using Unity ver. 2017.2.0b9.

 

And as far as I remember, I haven't changed anything. I'm in charge of the artwork while it's mostly the other guys handling the code so I'm just adding characters and animations at this point.

 

I double checked several times to make sure the characters all had the same settings and components attached so I don't know what else to try...

 

Edit: I've noticed something about the meshes in Unity. When I click on the good character meshes, they have a "Skinned Mesh Renderer" but when I click on the broken character, it has a "Poly Surface 13 (Mesh Filter) and a "Mesh Renderer".

 

Message 8 of 20
sean.heasley
in reply to: Anonymous

Hi @Anonymous

 

Hmm in that case it definitely looks like something is wrong with how Unity is interpreting those different character models/animations.

 

From the Unity documentation, The "Mesh Renderer" sounds like it is for just regular models that dont have any animation.

 

While the "Skinned Mesh Renderer" is for when Unity properly recognizes and tries to render bone animations.

 

Unfortunately I'm not sure why Unity is seeing this difference, could you possible try an older version of the character and see if that gets the Mesh Renderer label as well?

 

Let me know if anything changes!

 

Message 9 of 20
Anonymous
in reply to: sean.heasley

I've tried an older version of the character and same thing. I'm clicking
on the mesh and the skeleton and exporting the selection as an FBX file
into Unity.This is the same thing I did for the other characters so I'm not
sure what's different. I can't remember the exact steps and settings I went
through for the previous characters though so there could be something
different in how I export it from Maya, I'm not sure.
Message 10 of 20
sean.heasley
in reply to: Anonymous

Hi @Anonymous

 

Unfortunately this sounds like a specific issue based on a setting in your fbx export settings but I'm unable to tell what could be missing Smiley Sad

 

That said there's some Unity documentation on importing animations and this forum post on the Unity board that may be helpful to you!

 

Please let me know if this helps solve your issue or if you need any more assistance!

 

 

If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

 

 

 

Kudos are greatly appreciated. Everyone likes a thumbs up!

Message 11 of 20
sean.heasley
in reply to: sean.heasley

Hi @Anonymous

 

I'm just checking in again to see if you need more help with this. Did the Unity documentation I provided yesterday help you at all?

If so, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

Message 12 of 20
Anonymous
in reply to: sean.heasley

The documentation didn't help but the unity answers post did. Instead of exporting as a FBX, saving the file as an ma to my unity project directory worked.

Thank you and everyone who posted!

Message 13 of 20
ijacevedoXBD2C
in reply to: Anonymous

I know was over 2 years ago, but do you have a link to the thread that solved your problem. I'm having a bit of trouble with a school project on this.

Message 14 of 20

I can't believe it has been two years already. If the problem that you are having now is similar to the old problem, I have an idea about what it could be based on two of the elements from the original post.

 

You mentioned that the imported fbx didn't have a skinned mesh renderer, and the way you fixed things was to import a .ma version of the character into your unity project. This sounds like the fbx export settings from Maya might have been your problem from the beginning. Looking at your original post it looks like all the animation export stuff is turned off. (Image from your post below)

 

Settings.PNG

 

On that list, these boxes need to be checked. Animation, Bake Animation, Deformed Models, Skins, Constraints, and Skeleton Definitions. If these are selected your fbx file should come in with a skinned mesh renderer property and any animation from the maya file.

 

If your problem is something else it might help to start a new thread in case other people have a similar issue.

 

Hope this helps.

 

 

Message 15 of 20

I think its a different problem. Because Unity knows its an animation and will play it, but it makes the Mesh super huge

Message 16 of 20

I see, that is definitely a Unity centered issue. There is a field in the inspector for any fbx file under the model tab called scale factor.

 

Settings.PNG

 

This is 2018.3 so yours might look a little different if your using 2017, but any version of Unity that I have used has this. I believe the problem is that the size of the new model and the size of the animations are from are not the same. One may be in meters while the other is in centimeters which makes things look huge. The easy fix is to adjust the scale factor down until it matches the animation file scale. A good place to start would be .01.

 

You may want to post this on a Unity forum if it turns out this was the problem.

 

Hope that helps.

 

 

Message 17 of 20

Yeah, we did check. Only problem is that even its super huge, it says its 0.01

 

Message 18 of 20

Interesting, have you tried dragging one of the animation fbx files and the new character fbx file into an empty Maya scene to see how they compare. This could help to zero in on what the problem might be. If you want you could attach those files to a response and I can take a look.

Message 19 of 20
Anonymous
in reply to: kirbysteele

I used to have a lot of problems with getting animations to work from Maya to Unity, even after starting a new project a few years later. But now I know a lot more about how this all works and I have no problems what-so-ever.

 

One thing that took me forever to figure out is that I have to select the mesh, blendshapes, bones AND ALL the animation frames of the animation and then click export selected. I just assumed the animation frames were "attached" to the bones after baking and it never occurred to me to select them.

 

Anyway, you helped me out a lot to get to the point where I'm very comfortable with animating in Maya and exporting the animations to Unity. Thank you!

Message 20 of 20
kirbysteele
in reply to: Anonymous

Hey, I'm happy to hear that things are working better for you these days. The Maya to Unity pipeline is definitely a tricky one and it sounds like you have a good system in place for getting all your work transferred between programs. Make sure to use your new powers for good and not evil 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report