How to switch between animations if I animated my objects in Autodesk Maya and imported them into Unity? The default animation is running correctly, however Im not sure what should I do if I want to change it to another set of animation through scripting. Any kind help would be greatly appreciated!
Hi,
Considering that you have either:
A) Split a big animation into several smaller or
B) have imported the animations via different fbx by using basemodel@animationName per the unity manual…
…you should have an animation component on your gameObject that holds a list of all those animations.
From a script attached to the same gameObject you can simply call:
var cfadeTime:float;
animation.CrossFade("animationName", cFadeTime);
or
animation.Play("animationName");
animation is a monobehaviour variable which gets the Animation Component attached to the gameObject for you.