While Loop

These are easy to read and often used in coroutine. To set them up, add the while is true and then inside, add the routine inside. Then be sure to run the coroutine.

It’s bad practice to put these in with no way to stop since we can’t slow down the process. All of the memory will be consumed so be sure to always use them inside a coroutine.

You can run a while loop with an incrementor similar to a for loop so it knows when to stop.

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Al Heck

Unity Developer and Software Engineer who loves making games with GameDevHQ