Volumetrics-io / mrjs

An extensible WebComponents library for the Spatial Web
https://mrjs.io
MIT License
148 stars 9 forks source link

can't replay non-looping animation. #613

Closed lobau closed 2 months ago

lobau commented 2 months ago

When I setup a sound like this:

mySound.components.set('audio', {
    src: "./assets/audio/sound.mp3",
    loop: false,
    action: "stop"
})

I can then play this sound every time I do mySound.components.set('audio', { action: "play" })

Unfortunately, it doesn't appear to be the case for glb animations. If you setup an animation like:

myModel.components.set('animation', {
    action: "stop",
    loop: false,
})

You can play the animation the same way myModel.components.set('animation', { action: "play" }) but only once. Subsequent calls don't result in the animation being played again, regardless the status of the flag clampWhenFinished

hanbollar commented 2 months ago

ref

https://codepen.io/lobau/pen/WNWVmxM