While playing animation in 8th wall aframe-js there is delay for animation play

792 Views Asked by At

I have an animation, when I press a connected uibutton the animation plays, however, the first time the animation plays it has a slight delay before it starts.

On the js file I will have five of animations so clicking it plays consecutively.

How can I remove this delay?

Thanks!

   const animationList = ['Idle_static', 'open', 'close', 'popup']

    let idx = 1  // Start with the 2nd animation because the model starts with idle animation

    const nextAnimation = () => {
      newElement.setAttribute('animation-mixer', {
        clip: animationList[idx],
        repetitions: 1,
        crossFadeDuration: 0.4,
        clampWhenFinished: true,
      })

      idx = (idx + 1) % animationList.length
    }

    nextButton.onclick = nextAnimation
1

There are 1 best solutions below

1
On

First upload your model to one of the online glb previewer tools to see if the delay is also see there when you play/switch animations.

https://gltf-viewer.donmccurdy.com/

https://www.creators3d.com/online-viewer

Also, try using the Facebook fbx -> glb converter. Some of the other converters don’t handle animation timelines correctly. Link to it and other converter tools can be found at https://www.8thwall.com/glb