GLTFLoader play all animations

Hi there,

I have a problem playing all animations from a glb at the same time. The animations work, if I play only one of the file, but playing them all at once, it looks like it’s only working for the first two clips.

const animationGroup = new THREE.AnimationObjectGroup;
const mixer = new THREE.AnimationMixer(animationGroup);
const mixer = mixer;
const animationObject = Scene.find( o => o.animationClips);
animationObject.animationClips.forEach( clip => {
  const action = mixer.clipAction(clip));
  action.clampWhenFinished = true;
  action.loop = THREE.LoopOnce;
  action.play();
}

Thanks for any help!

Not all animations are compatible with one another, perhaps there is some conflict where certain animations override others? Changing to ‘additive’ animation might help if that’s the case.

If you play the animations together on https://gltf-viewer.donmccurdy.com/ do you get the same result?

Thank you for the tip. Playing all together works fine on donmccurdy.com. So, it must be an issue with my code.

I found the solution: We were using THREE.r120 which had some issues with animations obviously. After upgraded to r131 the animations run fine.

1 Like