Hi, guys:
I want use one button to pause/restart the animationGroup.
But I found animationGroup.isStart/isPlaying is not updated when restart it.
So I can’t how whether the animationGroup is paused or not. How cound I do?
demo to check:
AnimationGroup demo | Babylon.js Playground (babylonjs-playground.com)
- click ‘Play’ btn to start animationGroup
- click ‘Pause’ btn to pause it, the isStarted is still true, isPlaying changed to false
- click ‘Pause’ btn again to restart it, but the isPlaying is still false
so I can’t use isStarted/isPlaying to get the animation running state
Thanks.
Hello @jacksonyin , how are you doing?
I think this might be a bug in the API. I’m adding @RaananW just to be sure. I will open a ticket for it in the Babylon Github. As a work around I think you could add a AnimationGroup.play call after your restart call. This should flag the AnimationGroup as playing = true.
Here is a working example:
AnimationGroup demo | Babylon.js Playground (babylonjs-playground.com)
Link to Github issue: AnimationGroup.restart() does not set isPlaying to true · Issue #15416 · BabylonJS/Babylon.js (github.com)
thanks for your quick fix. Looking forward to the new version
1 Like