Character animation group sequencing

I have a character with animation groups. I want to begin an animation (eg. walking). When the animation is finished, another animation starts (eg. samba). And after samba, another animation starts (eg. walking again).

How can I do that?

Hi @fdsafda

You need to add a callback function to the onAnimationEndObservable. This callback function is called when the animation group completes. You can then start the next animation group in the callback function. This will require nested callbacks in this basic implementation PG

I also tried another approach that I think is better. It is basically doing the same thing but utilizes promise and await syntax sugar. You only need to provide a sequence of animation group names in an array. See the following PG: