Please note, I somehow manage to get things done, but I’m not an expert. Here’s my little guide to the events screenshot shown in that other thread. But all of this might be useless to you with your firestore thing, I don’t know.
ArraySelectIndex
is a number variable
SelectValue
is a number variable
ArrayValue
is an array with your questions, there will be 50 items in it etc.
Append value
You’ve done some firestone document thing which I know nothing about. The answer in that other thread is base on putting your questions in an array with each question having its own index, which will be there automatically.
Put all the items in the array, only two are shown in the screenshot. But you would have already put them in your array in the scene variables editor.
Get random index
You have 50 items, so this is where you’ll randomly choose one of them. But you’re not actually choosing a number from that list though, you’re just picking a number and then that gets assigned to the list in the next step.
The variable ArraySelectIndex
will be whatever number is picked. Let’s say it’s 18.
Get value from array
Assign whatever number was picked in the ArraySelectIndex
variable to the SelectValue
variable: 18
So, the player will be presented with question 19.
Remove element to index
We don’t want the player to get question 19 again.
Our question picker variable, ArraySelectIndex
is currently 18. Let’s get rid of that question number from your questions array ArrayValue
by removing whatever is at index 18.
Not shown, but it’s in the dice roll example
When there’s no questions left in the questions array because you’ve removed them all, then what happens? For the dice roll, the numbers were added back again but for your trivia game, you may have other plans. This is where I put things back by using clamp, so it may be irrelevant to you.
You could try to get this working with a small number of questions and then optimise it by experimenting or asking more questions here.