Hi.
I’m trying to crossfade 2 animations. First idle to walk after walk to idle, but when I try walk to idle the animation stops. So I need stop the animation that I interpolate to work.
Don’t work:
idle = model.mixer.clipAction( model.animations[ 0 ] );
walk = model.mixer.clipAction( model.animations[ 1 ] );
idle.play();
//CrossFade
walk.play();
idle.crossFadeTo(walk, 1);
//After 2 seconds, crossFade again
idle.play();
walk.crossFadeTo(idle,1);
Work:
idle = model.mixer.clipAction( model.animations[ 0 ] );
walk = model.mixer.clipAction( model.animations[ 1 ] );
idle.play();
//CrossFade
walk.play();
idle.crossFadeTo(walk, 1);
//wait time duration
setTimeout(function () {
idle.stop();
}, 1000);
//After 2 seconds, crossFade again
idle.play();
walk.crossFadeTo(idle,1);
//wait time duration
setTimeout(function () {
walk.stop();
}, 1000);
Is a limitation about CrossFade or has another way to make it?