AnimationGroups reset or gotoFrame

Hi, Babyloner’s!

https://www.babylonjs-playground.com/#TWKZ06#1

How i can reset AnimationGroup to begin? Perhaps it is a bug?
Please take a look on playground.

I just need set animation to frame-0-state. How we can make this?

It does not work because the animation was ended so it was not active but you can fix it like that:
https://www.babylonjs-playground.com/#TWKZ06#2

3 Likes

Artfully and simple, but i didn’t guess it ))
Thank you very much!

1 Like

I was facing a similar issue and this worked.

for reference, I’m adding the code here:

Instead of using

animationGroup.reset();         // no effect :*(
animationGroup.gotoFrame(0);    // no effect :*(

You should be using

aGroup.play();
aGroup.goToFrame(0);
aGroup.pause();
2 Likes

You can use the play() and goToFrame(0) methods. It’s a simple way to get the animation back to the first frame.