Search Unity

Mecanim and default values

May 30, 2014 in Technology | 1 min. read
Topics covered
Share

Is this article helpful for you?

Thank you for your feedback!

Hi there,

we are looking into how Mecanim handles its default values and  wondering if we should change it in the future.

Let’s get a bit technical!

The way that Mecanim currently works is that if a “property”– position, rotation, scale, float, animator parameter etc. - is animated by an AnimationClip in an AnimatorState, it will always be controlled by the Animator. This means that when transitioning into some AnimatorState that does not have an AnimationCurve for that “property”, it will be forced to its default value.

About this approach:

Pros:

  • States don’t have to handle default values themselves. So no need to clean up values at the end of the AnimatorState.
  • The current value of a property does not depend of which AnimatorStates were previously visited.

Cons:

  • Counter intuitive to have values forced to their defaults when not animated in an AnimatorState.
  • No way to have an empty AnimatorState that remembers the last pose/animation/sprite.

Do you see others pros and cons?

Our idea is to change the default behavior so that properties are not forced back to their default values when not animated.   How does that sound?

We could then offer the option to force write back of default values (like the current behavior).  We think of putting the option in the Animator itself.  Do you have uses where you would like to have a finer level of control over this?

Thanks for your time!

May 30, 2014 in Technology | 1 min. read

Is this article helpful for you?

Thank you for your feedback!

Topics covered