Error in animationGroup.goToFrame

#1

Hi,

I believe we have found an error when trying to use animationGroup.goToFrame. Please see the following example:

https://www.babylonjs-playground.com/#CBGEQX#33

  1. Press button 1 and it will go to frame 50 as expected.
  2. Press button 2 and it will play from frame 50 as expected. Let the animation finish.
  3. Press button 3 and it will go to frame 50 as expected.
  4. Press button 4 and it will not play from frame 50.

Why is step 4 failing?

We need to be able to jump back and forth between frames and play from there.

Any suggestions?

#2

Hey
This is because the animation is not in loop mode. So the 4th button try to go back in time and because there is no loop, the animation was stopped

Here is your fix:
https://www.babylonjs-playground.com/#CBGEQX#34

(just calling play(true))

#3

Hey,

Thanks for the suggestion, the thing is we don’t want the animation to loop. Is there a way to accomplish this, thanks.

#4

Ok so just restore the correct frame then:
https://www.babylonjs-playground.com/#CBGEQX#35

#5

Hi,

I have tried your suggestion, but button 4 does not play the animation :slightly_frowning_face:

Here is what we would like to do

  1. After loading scene, jump to a frame and play our animation (not looped).
  2. Once animation finish, jump to a frame and play our animation again (not looped).

Step 1 works fine, but once we try to repeat it (step 2), it fails. It jumps to somewhere and does not play.

#6

Sorry my bad:
https://www.babylonjs-playground.com/#CBGEQX#36

#7

Hi,

No, it does not work. Button 4 doesn’t play the animation :frowning:

#9

Rats… I badly checked :slight_smile:
https://www.babylonjs-playground.com/#CBGEQX#38

Better?