Animation Groups Not working

I have a animated model, and I took my code from https://www.babylonjs-playground.com/#BCU1XR#0

But when I click in the button Its dosent work.

But if I inspect on console I see the animation

When I run “skeleton.getAnimationRange(“yumeko|idle a”)” it return undefined

I try also direct from console and nothing

It just play the frist animation always

The AnimationGroups are not the same as skeleton.animations.

An AnimationGroup allows you to link together animations and meshes and play them, pause them and stop them as a group. (Group Animations - Babylon.js Documentation)

So in your case, you should just need:

scene.animationGroup[1].play(true)
1 Like

yes, works thanks.

and Its

scene.animationGroups[2].play(true)

How I do I go from scene.animationGroups[1].play(true) to scene.animationGroups[2].play(true)

What do you mean? Like you need to stop the first and then call the second?

Something like a smooth animation exchange

This is something you may be interested by:
https://doc.babylonjs.com/babylon101/animations#animation-blending

The idea is to flag all animations of an AnimationGroup with blending like that:

scene.animationPropertiesOverride = new BABYLON.AnimationPropertiesOverride();
scene.animationPropertiesOverride.enableBlending = true;

See #line 61: https://www.babylonjs-playground.com/#7A9BIM#10

2 Likes