- Home /
Animation.Play blends previous animation
Hi all,
I'm having a strange problem trying to play one animation. I'm using animation.play, that as far as I know should by default stop all the animations on that layer, however the animation doesnt play fully and I can see that is still crossfading some info from the previous one.
This is the code that use to play the first animation
animation.wrapMode = WrapMode.ClampForever;
animation[animationName].speed = 1.3f;
animation[animationName].weight = 0;
animation[animationName].layer = 0;
animation.CrossFade(animationName, 0.3f);
And this is how I play the second one:
animation[animationName].layer = 0;
animation[animationName].weight = 1.0f;
animation.Play(animationName);
How is it possible that the second one still crossfades something from the 1st one?
Thank you very much in advance for your help!
Answer by el-santia93 · Dec 02, 2013 at 11:20 AM
put them on different layers....might work
Thank you for the reply, unfortunately if I set the layer of the second anim to 1 I get the same results :(
Update on the above, I tried the following but I'm always getting the same result:
-blend weights set to 4 bones in the quality settings
-setting the layer of the second anim to 1
-Setting keyframes for all the bones for all the frames of the second animation in blender
-baking the f-curves of the animation in blender
-Deactivating the keyframe reduction in unity
Is there anything you can think of I might be missing?
Thank you very much in advance