Animation Groups Not working

#1

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

0 Likes

#2

I try also direct from console and nothing

It just play the frist animation always

0 Likes

#3

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

#4

yes, works thanks.

and Its

scene.animationGroups[2].play(true)

0 Likes

#5

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

0 Likes

#6

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

0 Likes

#7

Something like a smooth animation exchange

0 Likes

#8

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