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?
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.