Is there any way to run a script every X number of minutes?
For example
in 10 minutes {
animation.Play("Blank");
}
Is there any way to run a script every X number of minutes?
For example
in 10 minutes {
animation.Play("Blank");
}
Sounds like you want InvokeRepeating or perhaps a coroutine.
For example:
function Start() {
//10 minutes is 600 seconds
InvokeRepeating("Tick", 600, 600);
}
function Tick() {
Debug.Log("Ten minutes have passed");
}
This should work:
var PauseTime: float = 600;
private var NextTime : float = 0;
function Update () {
if (Time.time > NextTime ) {
NextTime = Time.time + PauseTime;
animation.Play("Blank");
}
}