character animation import in unity

hello all,
I being working on character animations to be set on a character model exported from maya in .mb format.

There is a animation linking problem. I checked the goober model example from character animation and moving in the same manner. And the animations are kept as

character
character@idle
character@run
character@punch

(every animation in different .mb maya format file, doing this to get the proper crossfade blending)

I thought its because of the rigs and controls the animation is not properly linking up.
So than again i baked the animation through key and bake animations. And exported the animated meshes itself in this same format

character
character@idle
character@run
character@punch

But no go and the animation is not linking up. So its just standing at the same first “character” phase and its not shifting to its animation of idle, run, or punch sequence.
Also i tried Bake Animations option which is provided in unity itself, but no result.

Moreover i tried simple animation on a sphere like wise
and the code i am using

function Start ()
{
   
   animation.Stop();

   animation.wrapMode = WrapMode.Loop;

}

function Update () {
   
      
   if (Input.GetAxis("Vertical") > 0.1)  
   animation.CrossFade("run");
   	        
   else
      animation.CrossFade("idle");  	   
   
}

sphere
sphere@idle
sphere@jump

and the same above code script, and the link up of other animation events worked nicely. And i can see the other animation is called and linked in a proper way.

But with the character animations i am facing problem as the animation are showing in the property window as linked up under different elements, but they are not working while giving them a call in the same manner with the same code script that is already working on the basic animations of sphere i made.

Is there any other way to export the animation that can work in unity, so that the other animation events can be fired in a proper way.

And want to know what i am missing here.

As couldn’t get the right way to make it work.

Double check that the animation bone structure has EXACTLY the same names as your character model. It’s the most common cause I have run into of animations not playing.

hi i’m a maya user too and i found a good way to have the animations working from maya to unity.
on the edit>bake simulation make sure you have selected the option below…

once the animations are baked delete all the ik handles execpt the ones that are parented to the root bone if you do have one parented to it.
don’t use the maya trax editor since unity doesn’t suport it. and set driven keys won’t work very well in unity other than that once baked and the model cleaned up on the import settings on unity put the frames of all the animations such as idle= 1 - 24, walk 25 - 46, etc…

and every time you add more animations to the model you have to redo all those steps and yes it does gets tedious having to write down each frame and specially if you have a lot of animations in one character model.

so what i do is to have a piece of paper and write down all the different keyframes of all my animations that i have on my models.

Double check structure in the imported files. There used to be a problem with linking if you have different amount of root-scene-objects in your files, it could result in different structures. There are workarounds for that and this has been fixed in Unity 3.2.