How to do set up a multiple-choice question at the end of my sidescroller level
No clue what to do
asked Apr 16 '18 at 06:37 PM in Blueprint Scripting
Sounds like you don't know about Unreal's UMG system yet. Have you checked out any of the tutorials about it? Mathew Wadstein has a lot of great ones on YouTube.
If I were the person making this system, I would create two Widget classes, one for the dialog box that holds the question and possible answers, and put a Text widget inside that one's canvas, and a Vertical Box widget under that.
Then I'd make an Answer widget class that is nothing but a button with a text widget inside of it. Then when I construct the dialog box widget. I have a function programmed on that dialog box class which takes in that pool of questions and/or answers as a parameter. I call that function right after creating the dialog box widget, and the function creates Answer widgets, setting their text elements to the answers in the pool which is an array of Strings or Texts.
You can call Shuffle on Array variables to randomly re-order them before calling this function.
Now the tricky part is how you're going to decide what happens when someone clicks the answers.
Your Answer class' button widget will have an OnClick event you can use to make stuff happen. You'll need to decide how to structure that so each answer does something different. You'll need to get rid of the dialog once an answer is chosen, I assume, as well.
answered Apr 16 '18 at 07:53 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here