Time interval
I was wondering is there any built-in function that allows triggering an event or running a function every sec or every defined time "Interval"
as an example like in JS
setInterval(function(){ alert("Hello"); }, 3000);
using the update event of course not only was a long code but also was very difficult not to make it call the function repeatedly
If there's nothing like that it'd be useful feature to have
hi Ahmed Aborady
try this delay function by time but try to do it with frame update
// -----JS CODE-----
// Wait for 2 seconds before executing a function
var delayedEvent = script.createEvent("DelayedCallbackEvent");
delayedEvent.bind(function(eventData)
{
print("delay is over");
});
// Start with a 2 second delay
delayedEvent.reset(2);
print("delay has started");
Have fun.