'Spark AR Trouble setting up timer

I’m trying to create a visible timer on my Spark Ar but couldn’t find the necessary information to start off. Does anyone have any tips? Thank you.



Solution 1:[1]

you can easily use the Time Module in the script to create a Timer

const TimeModule = require('Time');
const Scene = require('Scene');

const mySceneObject = Scene.root.find('mySceneObject');

var yourTime = null;
var count = 0;

yourTimer = TimeModule.setInterval(function()
{
if(count == 10)
{
 //do something here
mySceneObject.transform.scaleY = 10;
}
count++;
},timeValueInMilliSeconds);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Oliver