How can I add endless rotation to the object in SparkAR in code?
I tried something like this, but it doesn't work:
while(true)
{
myObject.transform.X += 30;
}
How can I add endless rotation to the object in SparkAR in code?
I tried something like this, but it doesn't work:
while(true)
{
myObject.transform.X += 30;
}
Try something like that:
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();