- Home /
Question by
Alex742 · Mar 05, 2018 at 12:43 AM ·
uiloading screenframes
Updating text from script multiple times not in 1 frame?
I have some code to generate a new level, and I have a text box to update the user on the progress of the generation, however because I do all the generation in on script my program waits until all the generation is done and then updates the text, missing out all the info in the middle.
I think its because it does it all in one frame?
Is there any way to update the UI mid script and not have to wait until the script is finished for the changes to occur?
Thank you
Comment
Look up Coroutines, move your generation function into a coroutine, and yield on occasion to allow Unity to render a frame.
Your answer
![](https://koobas.hobune.stream/wayback/20220612153943im_/https://answers.unity.com/themes/thub/images/avi.jpg)