[SOLVED] Load gltb Animations from File

Extending this example:
https://developer.playcanvas.com/en/tutorials/loading-gltf-glbs/

How would I load and setup the first present animation of an given file?
I’ve found out where the animations are within the asset, but I’don’t know how to proceed from here,
especially with the new anim/state workflow.

As always, thanks for any help on this.

if(asset.resource.animations.length>0){
   console.log("animation found");
   console.log(self.entity);
   //self.entity.animation = asset.resource.animations[0];
   //self.entity.anim.play(asset.resource.animations[0].name);
 }

See how its done here, this load visuals from one glb, and animations from separate glbs:
https://playcanvas.github.io/#/animation/blend-trees-1d

1 Like

Perfect, that’s exactly what I was looking for!
Thank you very much!