How to make a button select a question based on a randomized wheel?

How to learn how to boil the perfect pasta? Can anyone help please?

You’ve got multiple different things to learn. At a bare minimum:

  • how to respond to a button (in code)
  • how to spin a wheel and get a result
  • how to present a quiz question

All of those things have LOTS of existing tutorials out there.

You will NOT find a tutorial that does all three of these things. That’s not how tutorials work.

The idea is that you do the tutorials to learn the parts and how to integrate them into your final product.

Two steps to tutorials and / or example code:

  1. do them perfectly, to the letter (zero typos, including punctuation and capitalization)
  2. stop and understand each step what is going on, otherwise you’re just mimicking without learning

If you don’t do Step #2, you won’t be able to complete your project.

The good news is there is no better time to start than RIGHT NOW.

Stop making excuses!

https://www.youtube.com/watch?v=qqP6oa7ShRw

Hello, thank you for your kind reply. However it’s as useful as an umbrella in Sahara and next time make sure to read a question before giving your 2 cents. The code I pasted is a snippet, we have the wheel spin and the button action. The video you have sent requires me to enable tracking cookies so again, a very useless reply.

I’ve re-read your post a few times and I’m not quite sure what your question is. If you already have a wheel that works and selects between the three possibilities, then are you asking about how to load a new scene based on the result? Are you asking how to randomly select a word from an array?

Yes. Thank you! The array will contain a list of words and it shouldn’t repeat during a game. The solution we thought of was to start a coroutine and just delete the word that just got selected from the array everytime.

If you use a List instead of an Array, it is very easy to remove entries. You shouldn’t need a coroutine.

        //Assuming wordList is a List<string>
        int randomIndex = Random.Range(0, wordList.Count);
        string selectedWord = wordList[randomIndex];
        wordList.RemoveAt(randomIndex);

The code you pasted is unreadable and irrelevant as far as I’m concerned.

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

Like @dstears above, I am unable to decipher your original question.

This is a useful format to follow when you are posting a technical query:

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, log output, variable values, and especially any errors you see
  • links to actual Unity3D documentation you used to cross-check your work (CRITICAL!!!)

The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven’t put effort into finding the documentation, why should we bother putting effort into replying?