如何在代码中向SparkAR中的对象添加无限旋转?
我尝试了类似的方法,但是它不起作用:
while(true)
{
myObject.transform.X += 30;
}
答案 0 :(得分:0)
尝试类似的事情:
const Animation = require('Animation');
const timeDriver = Animation.timeDriver({durationMilliseconds: 2000, loopCount: Infinity, mirror: false});
const sampler = Animation.samplers.linear(0, 2 * Math.PI);
yourObject.transform.rotationY = Animation.animate(timeDriver, sampler);
timeDriver.start();