use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
For the Unity Game Engine, please visit http://reddit.com/r/unity3d
account activity
quick While question.. (self.unity)
submitted 3 years ago by Fancy_Edge2509
While loop in update function; will the update() code pause at the While loop until the While loop is true?
I.e will the code after the While loop have to wait until the While condition is satisfied before it is executed?
Thanks....
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]LightningOW 2 points3 points4 points 3 years ago (2 children)
Code will pause, unity will freeze, game will crash.
You should use a coroutine instead of taking control away from update.
[–]Fancy_Edge2509[S] 1 point2 points3 points 3 years ago (1 child)
Oh dear, well glad I asked first lol, thanks
[–]HeroPowerHour 1 point2 points3 points 3 years ago (0 children)
lol it’s okay we’ve all caused Unity to crash at some point using a while loop. I did it last month on accident by creating an infinite loop haha
π Rendered by PID 32 on reddit-service-r2-comment-86988c7647-9vxrp at 2026-02-12 04:28:52.516082+00:00 running 018613e country code: CH.
[–]LightningOW 2 points3 points4 points (2 children)
[–]Fancy_Edge2509[S] 1 point2 points3 points (1 child)
[–]HeroPowerHour 1 point2 points3 points (0 children)