Hello, I’m building a trivia game and one of the categories is basically a mixture of all 4 of my main categories. I have the code set up so when this game type (I call it endless/random) is selected, a global boolean is set to true, and the events in the main trivia scene load appropriately. Although, I’ve been having a weird problem that I can’t seem to fix.
As seen here:
When the next button is clicked, and the user has not gotten the answer correctly(or didn’t answer), the bottom event block is ran.
A random number from 0-50 corresponding with potential questions is generated and loaded into a variable, as well as the Category variable being loaded with value 0-3 of the EndlessCat(egory) array.
As the game proceeds, and the next button is clicked, sometimes the variable Question_Picked will change because a new random number is rolled, however the firestore document fields are not loaded.
So it will look sometime like this
Question 1: What color is the sky? A1:Red A2:Blue A3:Yellow A4: Green
(NEXT button is pressed executing the events screenshotted above) and the following SOMETIMES happens:
Question 39: What color is the sky? A1:Red A2:Blue A3:Yellow A4: Green
I am expecting the questions and answers to change because they are linked to the question number variable. So if it is displaying question 39, but the questions and answers are from question 1, it means something is failing to load, but I can’t figure out why(and why it only happens 10% of the time).
Most times the questions will load correctly, but sometimes only the question number variable changes, and the rest stay the same. I am confused on what I’m missing, if anyone would care to help me work on this problem I’d appreciate it greatly.
Thank You.