Hi @yash_mehrotra,
You can use setInterval
instead of setTimeout
, but this isn’t recommended since those timers run on their own even when the window is minized.
Usually you can setup a timer of your own in the update method of your script. Here is a useful post with some example code:
And also you can use the PlayCanvas tween library to execute code that animates/repeats things: