Hi guys
i have a simple animation when click on button to enable playing a clip
mmi.addHandler(‘Torus’,‘click’,function(mesh)
{
if(AnimationTrigger == true) {
action = mixer.clipAction(clip);
action.setLoop(THREE.LoopOnce);
AnimationTrigger = false;
action.clampWhenFinished= true;
action.play();
console.log( AnimationTrigger );
}
else{
AnimationTrigger = true;
action.paused = false;
action.timeScale = -1;
action.play();
console.log( AnimationTrigger );
}
})
a simple button clicks to play the animation and a second click to reverse it .
the animation works fine ( play and reverse ) but the issue i have is i need to use .setLoop(THREE.LoopOnce); to play the animation once, but if i click the button again to play the animation from start again it did not work
to be hosest i think ClampWhenFinished suposed to work alone logicley but Three.js documentation said we need to use it with LoopOnce
so how to activate play again after LoopOnce ??