Animation Blending

I’m trying to animate a simple avatar but finding it difficult to do the blending, my animation just kind of plays without blending away from the last animation clip.

I’m looking at this example but find the buttons confusing

Notice when you press, and click between idle, walk and run, especially walk and run, you will see it cuts to the next animation quickly.

I run the following in my code but it cuts to the next one without blending.

prevAnimPlaying.play(true)
prevAnimPlaying.setWeightForAllAnimatables(0);
this.animPlaying.play(true)
this.animPlaying.setWeightForAllAnimatables(1);

I’m trying to find a simple way of doing this without adding too much code ( sliders and such )

You may try to blend all animations in all groups. Here is the piece of example code:

    for (let aniCounter = 0; aniCounter < container.animationGroups.length; aniCounter++) {
      for (let index = 0; index < container.animationGroups[aniCounter].targetedAnimations.length; index++) {
        let animation = container.animationGroups[aniCounter].targetedAnimations[index].animation
        animation.enableBlending = true
        animation.blendingSpeed = 0.02
      }
    }
3 Likes

That was a super fast solve, thank you!!!

2 Likes