How do I trigger the animation for cloned objects? Do they each need their own animation? here is my code…
const loader = new THREE.GLTFLoader();
loader.setPath(assetPath);
loader.load('coin_v01.glb', object => {
actions = [];
coin = object.scene;
mixer = new THREE.AnimationMixer(object.scene);
object.animations.forEach( anim => {
const action = mixer.clipAction(anim);
actions.push(action);
});
actions[0].play();
scene.add(coin);
for(let count=0; count<1000; count++) {
const coinClone = coin.clone();
coinClone.position.z = count*2;
scene.add(coinClone);
}
update();
})
This works, but only the first object plays the animation.
thanks for any help,
Dale