Download

Loop through series of questions

What is the best way to loop through a series of questions?

I’d like to put a series of questions and answers into a data table and then have the user goes through these questions. Present the first question and multiple answers, wait for the user to click an answer, then continue with the next iteration of the loop. I’m able to pull up the questions and answer from the data table, but I’m not sure how to pause the loop or wait for input from the user before the next iteration.

Event dispatchers.
Make custom widget, that waits for user to pick answer. Then dispatches event “user answered”.
Then your player controller, binds to that event.

You could use gate, or on tick event to pool some variable that is set to true when user replies, and set to false when you spawn new question.
Then you do not spawn new question until that variable is true.

But pooling variable in event tick is not so classy as events.