# \[SOLVED\] Load gltb Animations from File

**URL:** <https://forum.playcanvas.com/t/solved-load-gltb-animations-from-file/29715>\
**Category:** Help & Support\
**Tags:** animation\
**Created:** [February 14, 2023, 3:36pm UTC](https://forum.playcanvas.com/t/solved-load-gltb-animations-from-file/29715 "2023-02-14T15:36:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rechi](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/rechi/32/7775_2.png) [@Rechi](https://forum.playcanvas.com/u/Rechi)\
**Post date:** [February 14, 2023, 3:36pm UTC](https://forum.playcanvas.com/t/solved-load-gltb-animations-from-file/29715/1 "2023-02-14T15:36:07Z")

</div>

Extending this example:  
[https://developer.playcanvas.com/en/tutorials/loading-gltf-glbs/](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.

```javascript
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);
 }

```

---

<div class="post-metadata">

**Author:** ![mvaligursky](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mvaligursky/32/11681_2.png) [@mvaligursky](https://forum.playcanvas.com/u/mvaligursky)\
**Post date:** [February 14, 2023, 6:24pm UTC](https://forum.playcanvas.com/t/solved-load-gltb-animations-from-file/29715/2 "2023-02-14T18:24:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rechi](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/rechi/32/7775_2.png) [@Rechi](https://forum.playcanvas.com/u/Rechi)\
**Post date:** [February 14, 2023, 7:58pm UTC](https://forum.playcanvas.com/t/solved-load-gltb-animations-from-file/29715/3 "2023-02-14T19:58:04Z")

</div>

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