In-game quiz

Hello guys! I want to make quiz like banjo kazooie “Gruntildas furnace fun”

This consist on a lot of platforms, each of them have activates a question:

261017-gruntildas-1.jpg

After pressing a button on the platform, it focuses other camera and start a “question script” which consist on a multiple question and a timer:

261018-gruntildas.jpg

And of course, after selecting the question, it returns to the normal controls and the first camera with the player.

Well… after this, my question is. I already have the first part (Recognizable platforms to know what kind of platform is and what type of question should be triggered) But im really new on this, so… What is the best way to do questions like in this famous game?

i imagine you could do all your looking to do with a widget. i would create a actor for the platform which when activated (overlap, input, etc) would create the widget and set the question category. the categories could be a set of arrays or a datatable which contain the questions.

as for the widget itself you may want to first switch the input mode to ui from game. then you will need to create the buttons which display the answers and a text component which displays the question, you then need to have a script which sets the value of these components based on the question in the array. from there all you need is a way to check if the button clicked is the right answer. to do this you will need on clicked events which run a script to check the answer, id go with something like having each button represented by a number then you check that against a number which represents the correct answer. you could easily store all the information in a struct format (question, answer 1, 2,3,4 right answer).

theres a few posts out there that go into detail on making a system like this (i wrote a few answers myself on it a few months ago).

hope this helps get you started, if you need more help post and i may be able to provide a in depth solution later.