I need to call a function once per second for X number of times. How can I do this?
I can't use an IEnumerator because "yield return new WaitForSeconds(5);" inside of a For Loop exits the For Loop, and it only runs one time.
I can't use InvokeRepeating, because I need to loop X number of times.
Been at this for an hour or 2, can't figure out any way to:
**Loop a function, once per second, X number of times.**
Just like this: (But this code only runs one time)
for(int i=0; i < total; i++){
yield return new WaitForSeconds(1f);
}
↧