Asking multiple choice question in unity from a file delimited file in excel?

I want to ask people in a trivia game a question from a file delimited file in excel and have multiple questions per room, and through out, no questions re-asked, then a door will open if the majority of them are answered correctly, if not majority correct, then the game boots to main menu. what would the code for this be and how would i implement it to my game. Any help ASAP would be greatly appreciated! thanks guys! :slight_smile:

This is a wide open question that is difficult to answer with such a sketchy description. You might have better luck if you take your project a piece at a time and then ask specific questions on the list. Here are two suggestions on places to start.

  1. For asking the questions, you’ll likely use the GUI class. There are many questions daily that either use GUI methods in their source or ask about GUI. Create a simple project that just asks and answers questions using GUI. Don’t worry about your Excel data to start, just put your questions in code or make a public array and fill them in in the inspector.

  2. To get your information from Excel into Unity, save it as a .CSV file with .TXT extension. There are other formats you could use other than CSV, but CSV is probably the simplest. To Unity, anything with a .TXT extension is a TextAsset so you can use the methods of the TextAsset class to access the file. You will have to parse the file yourself and move it into a data structure you can use when asking the questions.