Ive got a lot of code that Im trying to run in a coroutine function. I’ve tried placing yield wait for seconds at the ends of loops and that helps, but is there a way to just evenly pace out the code?
To be clear, I’m not just trying to slow the loops, but the execution of the entire code block over a variable amount of frames.
Coroutines are built to do what I believe you are asking, they work as if you wish to loop code or until a statement is true, then proceeds with the coroutine.
The above code will only execute the while loop when it is true, make the while loop false, and it will then proceed to the next while loop… Rinse and repeat. understand what I am getting at?
On the other hand, if you do not wish to user Co routines, I suggest delegates. Delegates found at this link might help you understand, and it might create a solution to your problem.