CrossFade help - Solved

Solution : The idle animation was not correctly influencing the required bones.

I have two animation clips (“idle” and “animation1”) defined through the split on a game object.
“idle” is a loop while “animation1” is clamped “Once”.

On a button press I call

gameObject.animation.CrossFade("animation1");

and it looks like that the animation1 fades in and the idle animation fades out correctly.

I have defined an AnimationEvent that shall fade out “animation1” and fade in “idle” just calling

animation.CrossFade("idle")

It seems that the animation1 does not completely fade out and its influence still remains.

Does the CrossFade need to be invoked multipletimes, or the engine just keeps updating the animations weights on its own?

Shall I call CrossFade in an Update function instead of calling it once? (I tried but it didn’t work)

Could somebody kindly help?

Many thanks.

So, how was this solved? I kind of have the same problem. My crossfade from “walk” to “idle” works only for the upper part of the body. Which is strange. The animation was made in Cinema4d on the same time-line.

http://www.sushitek.com/ecoman

function Update ()


{
   if (Mathf.Abs(Input.GetAxis("Horizontal")) > 0.1)

       animation.CrossFade ("walk",0.1);

   else
      animation.CrossFade ("idle",0.1);
}