Creating a multiple choice question game with arrays and UMG?

Hello,

I have tried my hand at this. The first thing I did was to set up a question structure:

The next step is to setup a “design” in UMG designer:

At this point I made a variable for each post in the struct and call them Current + ‘StructVariableName’. I also made a Questions array which has the Question Struct as it variable type. All the text variable must be bound to its relevant text component in the designer. Here are both a list of the variables (left row) plus the first part of the blueprint:

Construct Event is used to set up some start values and other things. QuestionSetup is used to pick out the current question from the array and put it into the relevant text variables.

Here are the button events. When one of the buttons is clicked that buttons event node will fire, it sets the answer index and triggers the parse answer event:

Here is the last part, the ParseAnswer event. It will check the current answer and in this case just print some text to the log (corrent answer or wrong answer). Then it will trigger the next question setup (or quit if there are no more questions):

This is a quick and dirty example and hope it can at least give an idea how to develop this further. It is most probably not the best or fastest way to do this, but it gets the job done (so to speak).

Ask if there are any questions!!!