CrossFade between tow animations?

Jun 4, 2011 at 10:45 PM

Hi
im using xnaimation lib , and i want to know how the CrossFade is work .
i want to transform from the idle animation to walk animation with smoothly .
i want to know where is the wrong :

if
(padState.ThumbSticks.Left.Y < 0.2f && padState.ThumbSticks.Left.Y > -0.2f) 
{
 
// this mean player is standing
currentState =
"idle"; 
animationController.LoopEnabled =
true; 
animationController.CrossFade(skinnedModel.AnimationClips[
"idle"],TimeSpan.FromMilliseconds(300)); 
animationController.Speed = 3.5f;
 
}
 
if (padState.ThumbSticks.Left.Y > 0.2f && padState.ThumbSticks.Left.Y < 0.7f) 
{
 
// this mean player is walking 
currentState =
"walk"; 
animationController.LoopEnabled =
true; 
animationController.CrossFade(skinnedModel.AnimationClips[
"walk"], TimeSpan.FromMilliseconds(300)); 
animationController.Speed = 0.8f;
}

in another case if i use the "startClip" way instead of "CrossFade" , i can play the animation withe sharp transform .
please could some one help me ?