Change the speed of InvokeRepeating?

At the start of my scene, if I repeatedly invoke a function, is there a way to change the speed at which the function is invoked(ex: it starts out repeating every 5 seconds, something happens and then it switches to every 2)?

Have you trying canceling the invoke then starting it with the new timer?

But if I do that, if I check to see if the condition has been meet inside the update function, and then cancel the function and then invoke it with a new time span, it just continually invokes every frame (because it is inside the update function).

Don’t use Update, there’s no reason for it here. However, a coroutine using yield WaitForSeconds might be more appropriate than InvokeRepeating for this.

–Eric