AnimationGroup TargetedAnimation doesn't start at the correct frame on first playback

Hi altogether,

I have multiple animations with different start times that should play together, so I’ve added them to an AnimationGroup.

Playing them back for the first time starts all animations immediately, even if some of them should be delayed. On every following playback it starts correctly. I believe this shouldn’t be the case.

Playground: https://playground.babylonjs.com/#GCRAN6#2
The first cube should start immedately and the second should align halfway through the motion. But on the first playback, both start immediately.

Thanks in advance!

1 Like

Hey and welcome back!

Let me check your PG:)

Ok this is because your second animation has no key at frame 0. Here is the version with a key at frame 0:
https://playground.babylonjs.com/#GCRAN6#3

The group (as a group) will run all the animations on the same timeline hence our problem. Other option is to ask the group to normalize the animations (with group,normalize()):
https://playground.babylonjs.com/#GCRAN6#4