问题描述
我有一个动画,当我按下一个已连接的uibutton时,动画会播放,但是,动画第一次播放时,开始播放会稍有延迟。
在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预览器工具中,以查看是否在播放/切换动画时也看到了延迟。
https://gltf-viewer.donmccurdy.com/
https://www.creators3d.com/online-viewer
此外,尝试使用Facebook fbx-> glb转换器。其他一些转换器不能正确处理动画时间轴。链接到它和其他转换器工具可以在https://www.8thwall.com/glb
中找到