猫史档案馆


有人帮我改改这个代码吗?求助

用户:Henry_嘟Henry_嘟查看:1 回复:1 评论:1 创建时间:2022-03-21T10:17:23


let names=[          {na:"-1",as:[89.6 , 12.1 , 73.7],us:[98 , 12.1 , 73.7]},     {na:"-2",as:[58.1 , 10.2 , 53],us:[58.1 , 25.9 , 53]},           ]

 

let elevator let endPos let startPos let ani for (const eq of names) { //遍历names中的每一个元素     elevator = world.querySelector('#滑板1'+eq.na) //获取电梯板实体     endPos = eq.as//电梯的最高位置///     startPos = eq.us//电梯的最低位置///!!!     ani = elevator.animate([// 1+5+1+2=9, 总时间15秒被切成9份         { position: startPos, duration: 3 },// 1/9 的时间停留在地面         { position: startPos, duration: 4 },// 5/9 的时间用于地面往楼顶移动         { position: endPos, duration: 1 },// 1/9 的时间停留在楼顶         { position: endPos, duration: 1 },// 2/9 的时间从楼顶回到地面     ])

 

        ani.play({             duration: 16 * 5, //播放一个循环共用时15秒(每秒16帧),             iterations: Infinity,//动画无限次循环播放             direction: Box3AnimationDirection.WRAP,//让动画实体从终点回到起点         })   }   报错是这样的: center_image


回复

上一页1 页 / 共 1下一页
yee089yee089

检查一下elevator有没有animate这一项。

如果有,那么就是神奇的bug。如果可以运行,直接在报错的地方加一句console.clear()就彳亍了

点赞1


评论