Play animation from GLB

Hi there.

I tried a few different guides on how to make my GLB with animations play in three.js. I tried this for starts, but it doesn’t seem to work: three.js docs, nor do I know the name of my animation. I tried to console.log() it, but I couldn’t find the function to do that either.

I am sure it is applied correctly as I opened the .GLB in blender and tested the animation.

This is my site where the three.js script is active: https://www.mattiasbaldi.com/
This is my code (without trying to add animation): JS Bin - Collaborative JavaScript Debugging

This is my .glb:
mb.glb (659.2 KB)

In your load callback you gotta grab the animations and play them… something like this:

let mixer = new THREE.AnimationMixer();

                                loader.load('/mb.glb', (gltf)=>{
                                    model = gltf.scene;
                                    scene.add(model);

                                    //scaling
                                    model.scale.set(.14, .14, .14);
                                    // Adjust scale for the model

animations = gltf.animations;
let action = mixer.clipAction( animations[0] , model);
action.play();

                                }
                                );

then in your main update loop (RAF) call:

mixer.update( 1/60) ( or deltaT )