2
\$\begingroup\$

I have two models (one animation in each) which I got for free from Mixamo. I imported them in Unity and they look like this:

https://i.stack.imgur.com/iDZ7l.jpg

Justin@Idle and Justin@Walking.

As can be seen from the picture, they both contain only one animation (idle and walking). But in my scene I have a couple of other character models.

But I am unable to get these two animations (idle and walking) to work on any of those models at all. (I am pretty confident that they have the same skeleton, since they are coming from the same 'pack').

What are the steps I need to do in order to get these two animations to work on every character and I can trigger them by scripting in c#?

I figured out that I need to make the .fbx rig as 'Humanoid' I suppose, but since these .fbx files don't contain the animations the Animations tab does not contain anything.

This picture shows my situation: https://i.stack.imgur.com/2cLfh.jpg

I would like to write in my code something like this:

npcObj.GetComponent<Animation>().animation.Play("idle"); 

or

npcObj.GetComponent<Animation>().animation.Play("walking");

I tried adding the animations in an Animation component and calling them in script like this, but the model keeps having its T-pose.

Thanks to whoever can help me!

\$\endgroup\$
1
  • 2
    \$\begingroup\$ I'm not able to write a complete answer at the moment, but the gist is to use the Mecanim system instead of Legacy animation: create an Animation Controller, make the animation fbx a state in the controller, and then assign that controller to your model. \$\endgroup\$
    – jhocking
    Jan 2, 2015 at 18:41

1 Answer 1

1
\$\begingroup\$

Essentially what you're looking for is Unity's Retargeting of Humanoid Animations. http://docs.unity3d.com/Manual/Retargeting.html

Basically as I understand it, as long as the rig you imported with the models/animations meets Unity's Avatar and muscle definition criteria for a humanoid character, then you should be able to use that rig and subsequent animations on other compatible models.

Additionally, you probably need to check if the free models you got from Mixamo are actually compatible with the Mecanim system in Unity. I know that some of the older Mixamo packs were actually incompatible and only worked in the older (before Unity4 I believe) Legacy animation system. If so, then you'll need to update their armatures etc in Blender or Max etc.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .