Playing timelines in sequence via scriplt?

What’s the best way play timelines in sequence from a script?

I have imported an FBX animation with several timelines. Everything seems to be intact, and the timelines play just fine in the symbol editor. However, I need to play them in a specific sequence from a script - e.g…

My_Anim.controllers.animations.timeline('Anim 1').play();
My_Anim.controllers.animations.timeline('Anim 2').play();

Obviously, the above won’t work due to the async nature of JS, so I’m wondering, what is the proper/best way to do that? I can’t seem to find the answer in the docs.

Use the timeline’s “complete” event handler…

My_3D_Model.controllers.animations.timeline('Anim 1').on("complete", () => {
	My_3D_Model.controllers.animations.timeline('Anim 2').play();
});

:blush: