Javascript 在第八墙aframe js中播放动画时,动画播放会延迟

Javascript 在第八墙aframe js中播放动画时,动画播放会延迟,javascript,aframe,8thwall-web,Javascript,Aframe,8thwall Web,我有一个动画,当我按下一个按钮时,动画播放,但是,第一次播放动画时,它在开始之前有一个轻微的延迟 在js文件上,我将有五个动画,所以点击它会连续播放 我怎样才能消除这种延迟 谢谢 const animationList = ['Idle_static', 'open', 'close', 'popup'] let idx = 1 // Start with the 2nd animation because the model starts with idle animatio

我有一个动画,当我按下一个按钮时,动画播放,但是,第一次播放动画时,它在开始之前有一个轻微的延迟

在js文件上,我将有五个动画,所以点击它会连续播放

我怎样才能消除这种延迟

谢谢

   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

首先将您的模型上载到其中一个在线glb预览工具,以查看延迟是否在播放/切换动画时也会出现


另外,尝试使用Facebook fbx->glb转换器。其他一些转换器无法正确处理动画时间线。可以在

Hi找到它和其他转换器工具的链接,欢迎使用堆栈溢出。请发布一些到目前为止您尝试过的代码。const animationList=['Idle_static',open',close',popup']让idx=1//从第二个动画开始,因为模型从Idle animation const nextAnimation=()=>{newElement.setAttribute('animation-mixer',{clip:animationList[idx]开始,重复次数:1,crossFadeDuration:0.4,clampWhenFinished:true,})idx=(idx+1)%animationList.length}nextButton.onclick=nextanimation感谢您的回复,facebook converter不导出动画,但我在播放动画时移除属性,并再次添加动画混合器组件,解决了此问题。