Looping script


#1

How do we loop a script? I have an on/off state of my object and I’d like it to keep repeating.

parent.on(“pointerdown”, (e) => {
symbol.controllers.Stage_1.elements.Off_toOn.play();

parent.on("pointerdown", (e) => {
symbol.controllers.Stage_1.elements.On_toOff.play();

});
});

Thanks


#2

Perhaps this should help you:
https://docs.zap.works/studio/scripting/introduction/utility-functions/every/


#3

It worked. Thank you!!