- Home /
How to make my code stop running, until the player responses to a prompt
I have a problem. Once player presses a button, there are calculations going on, however, during that time, program, before going further with its calculations, needs to ask the player for some variables. However, if i create a prompt window and simply make it visible, once the question is required, the game will disregard the window and follow with its calculations, delivering bad results, as it lacks some variables, because player didn't input them.
How can i make my program to wait for player to react to prompt, before continuing its work?
Answer by TSI25 · Aug 29, 2017 at 08:00 PM
You probably want to use a coroutine which will wait until the user hits an "OK" button after entering those values into a window. At the end of the coroutine you would do the rest of the calculations given their input.
Your answer
![](https://koobas.hobune.stream/wayback/20220612133820im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Changing UI for network chat 1 Answer
UI Click pass through 1 Answer
Two dynamic dropdowns from one source list 0 Answers
Load different render textures into Raw image object 0 Answers