Hello there,
After the last release which fixed a bug I reported, (AnimationGroup reset method unexpectedly triggers onAnimationGroupEndObservable, thanks for the fix and the release), I found out the onAnimationGroupEndObservable seems to only be able to trigger once. But maybe this is intended ?
Another possibly unexpected behavior is how reset seems to keep the playing/paused state of the animation. You can now clearly see this in my playground from the previous post. The animation doesn’t need to be restarted when reset halfway through, but doesn’t restart when it ends.(https://playground.babylonjs.com/#7V0Y1I#4098)
Thanks in advance for looking at it !
I found out the onAnimationGroupEndObservable seems to only be able to trigger once. But maybe this is intended ?
You mean you expected to onAnimationGroupEndObservable to trigger during the reset? I expect that reset
is intended to just “start over”, but @Deltakosh may be able to comment more.
Another possibly unexpected behavior is how reset seems to keep the playing/paused state of the animation.
I think this may also be expected behavior. If you want to change the state at the same time as reset, you can call stop
and then reset
(which also triggers the onAnimationGroupEndObservable that I think you are looking for).
The animation doesn’t need to be restarted when reset halfway through
I think this is the same as the previous comment, right? Meaning reset
resets where the animation is on its timeline, but doesn’t change the start/stop state.
but doesn’t restart when it ends.
I may be misunderstanding this one, but the animation won’t restart on a normal end unless it is configured to loop, right?
I would have thought that you would get the behavior you are expecting if you explicitly stop/start the animation group when resetting it, and also explicitly starting it in your onAnimationGroupEndObservable handler. I tried this and was surprised the onAnimationGroupEndObservable didn’t trigger when the animation ended. Let me look a litle more…
Hello,
sorry for being away when you were looking at the issue. My post was not the clearest it could have been. In addition to covering the onAnimationGroupEndObservable issue, I wanted to make sure the behavior i saw regarding “how reset seems to keep the playing/paused state of the animation” was correct because I think the reset
method documentation is ambiguous.
Reset all animations to initial state
Does the initial state includes the paused/playing state ?
Thanks to @ryantrem, I now know the answer is no. Thanks to you as well for the fix.
Marking this as solved
2 Likes