With a normal JavaScript implementation I would suggest using setTimeout()
, but the Unity documentation suggests using Invoke()
(see the docs).
function doStuff() {
if(condition == true) {
...
}
else {
Invoke('doStuff', 1);
}
}