- Home /
Question by
simplicitygs · Jul 29, 2014 at 11:13 PM ·
loop animaiton
Repeat loop every 5 secounds
I am trying to make a loop repeat every 5 seconds. I have tried looking up how to do this and can't figure it out. Would anyone be able to give me and example?
Comment
Best Answer
Answer by rutter · Jul 29, 2014 at 11:16 PM
You want the InvokeRepeating function:
function Start() {
//call "Tick" every five seconds
InvokeRepeating("Tick", 5, 5);
}
function Tick() {
//do whatever you want, in here
//simple log statement for demo purposes
Debug.Log("Tick");
}
For more information, check the manual page I linked above.
Your answer
