One robust way of doing this is creating a float timer that you add deltaTime to during update, sort of like this. timerActive is a bool that is true when you want the timer to go.
void Update () {
if (timerActive) {
timer += Time.deltaTime;
}
}
and then check and reset the timer like this
if (timer >= delay) {
//Do stuff
timerActive = false;
timer = 0;
}
↧