Closed lobau closed 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" })
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
myModel.components.set('animation', { action: "play" })
clampWhenFinished
ref
https://codepen.io/lobau/pen/WNWVmxM
When I setup a sound like this:
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:
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 flagclampWhenFinished