Question Action¶
Question Prefab Constructor¶
In order to create a Question Action, the most important part is to set the Question Prefab Constructor correctly.
First and foremost, we will spawn our Question Prefab example. To do so, we will drag and drop it either on the hierarchy or in the scene. After spawning the prefab, click on it. In the inspector tab you will be able to see the Question Prefab Constructor.
In the above photo we can see an example of a ready-to-use Question Action. We can see that the script has a lot of fields. The main distinguish in the script is between the different option types. There are three option types:
Header Options
Question Options
Other Options
Now, we will break up and analyze its option:
Header Options: This groups the functionalities of the header UI. It has 3 fields:
Allow Text Header: If true, spawns first the header UI and then the options.
Text Header Lifetime: For how many seconds the header UI will be visible.
Text Of Header: The text of the header UI
Question Options: This groups the functionalities of the Options UI. It has 3 fields:
Max Questions: The total amount of questions.
Answers With Order: If true, then there will be a choice order.
Option List: List of the option. There you can set which option is the correct one, the order of it and the text of the option.
Other Options This groups some functionalities of the UI. It has two fields:
Shuffle Options: Spawns the options randomly each time
Reveal Correct Answers: After answering the question, the system will reveal the correct answer.

Now, we just save our new prefab and copy its’ path and paste it in our Question Action script.