Skip to content
Advertisement

How to control .glb model animations in A-FRAME via Three.js

I’m trying to play a glb animation in A-FRAME with Three.js, now it works just for a second and then it stop, could someone help me please? this is my code:

JavaScript

Advertisement

Answer

  1. Wait until the model is loaded with:

    JavaScript
  2. update the animation in the renderloop – on each tick. You could use an interval or something else, but aframe has already a built-in function for this purpose:

JavaScript
Advertisement