GLTF Animations Automatic

Hi all, if we have a .glb with more than one animation and we want them to show one behind the other in a row in an automatic way, how could we do it ?, that is, if we load the animations and give each one .play () , will be reproduced at the same time, however if we want to reproduce for example, the 1, when it finishes, then the 2, etc. … automatically, that is to say without using .startAt (). It does not matter how long the animation lasts, simply that when one is finished, continue with the next one as a .loop, but with different animations.

One approach to solve this is to register an event listener to the animation mixer’s finished event.

mixer.addEventListener( 'finished', ( event ) => {

	console.log( 'Finished animation action: ', event.action );

	// start next animation

});

In this way, you automatically know when an animation action has finished its playback and then start the next one.

3 Likes

Ok, thx @Mugen87 .I’m trying with .time or .getTimeScale :expressionless: