Mecanim FAQ

General questions

We are using the animation Legacy System for the player animations, do you advise us to use Mecanim instead?

Mecanim is the current animation tech that we are developing, and it will improve continuously. The legacy system is "as is" To check out the features and cool stuff you can do with Mecanim check here: http://unity3d.com/unity/mecanim/

how can I access Mecanim functions via script?

Most functions in Mecanim can be controlled by script, but We are exposing the entire API in increments over the 4.x development cycle

How can I create new animations for humanoid characters?

You can animate in any of the 3D animation packages listed here http://docs.unity3d.com/Documentation/Manual/HOWTO-importObject.html and import them into unity

In Mecanim, How can I change the motion of an Animation State?

You can use a write a controller script (or use one from our demos) to interact with the State Machine which plays the animations. Here ares some links:

Import

Why is an animator added automatically to every mesh that's imported?

Currently there are no methods by which to set import defaults, but if you set the Rig to ‘None’ in the import settings, then the Animator component will not be added - you can do this with multiple files at once

Layers

Does it matter in what order the layers are in?

Yes. Layers are evaluated from the top one to the bottom one. Layers set to “override” will always override the previous layers (based on their mask, if they have mask)

Is there a built in way to fade between layers?

There is no “automatic” mode for layer weights. Using your own fade in/out can be good approach *

Is the base layer weight always supposed to be one or should the weight be set to zero when another synced layer is run?

The base layer weight is always 1, however setting layers to *override* will completely override the base layer.

What happens if a synced layer has a different length to the corresponding state in the base layer?

If layers would have different lengths, the synced layers would become unsynced.

Is there any way to get a variable value from the controller without the name in text format?

You can use integers to identify the states and parameters. Use the Animator::StringToHash to get the int identifiers. For example:

runState = Animator.StringToHash("Base Layer.Run"); animator.SetBool (oneOffRun, false);

Avatars and body Masks

Is there a way to define what bones should be part of a body mask?

Body mask are tightly bound to the humanoid re-targeting solver, so currently it is not possible.

Is there a way to create more AvatarIKGoals than LeftFoot, RightFoot, LeftHand, RightHand?

We have this on our roadmap

Animations curves and events

Can you add animation events to Mecanim?

This is on our high priority roadmap. We suggest using Additional animation curves on animation to “simulate” events. Its not exactly the same, but many of our users have had success with this!

How do animations with Curves blend with animations without?

When you have an animation with a curve and another animation without a curve, Unity will use the default value of the parameter connected to the curve to do blending. You can set default values for your Parameters, so when blending occurs between a State that has the a “Curve” Parameter and one that does not have one, it will blend between curve value and default parameter. To set a default value for a Parameter, simply set its value in the Animator Tool window while not in LiveLink.

Page last updated: 2013-03-05