CTIN 289 - Interactive Snippets Library

Powered by 🌱Roam Garden

Invoke


//use with the string name of a method; the method cannot take parameters

Invoke(“Method”, 0.5f); //parameters: method name string, float time until method is executed

InvokeRepeating(“Method”, 0.5f, 0.5f); //a repeated version of Invoke

//parameters: string method name, float time until method is executed the first time, float time between method executions after that

//to stop an invoke from happening:

CancelInvoke(); //cancels all invokes on the monobehaviour

CancelInvoke(“Method”); //cancels any invoked function w/ that name