Search Unity

Load random 50 questions from 500

Discussion in 'Scripting' started by KIERO_, Oct 23, 2021.

  1. KIERO_

    KIERO_

    Joined:
    Oct 22, 2021
    Posts:
    4
    Hello,

    I've made 500 questions for my Quiz Game, but it just randomize 500 questions and the person have to answer on all of them. Is there a way to pick random 50 questions from my list of 500 questions and start the game?
    If needed, I can give you a full source code of the game because it's already on the internet :D

    Maybe there is something to do with this line of code?:
    upload_2021-10-23_15-33-54.png

    I have all questions listed here, (1 question is 1 file):
    upload_2021-10-23_15-36-26.png

    Any way to fix this?
     
  2. RadRedPanda

    RadRedPanda

    Joined:
    May 9, 2018
    Posts:
    1,648
    Can't you just have them answer the first 50 of the random 500?
     
    Bunny83 and Kurt-Dekker like this.
  3. KIERO_

    KIERO_

    Joined:
    Oct 22, 2021
    Posts:
    4
    I mean, I have 500 questions here.
    When I start the app, I do not have only 50 questions but 500 randomized (in different order).
    But I want to select random questions out of 500 and start the app.
    I just don't know what to do to make them select 50 random ones and deal with it.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Shuffle the list, pick the first 50.
     
    Bunny83 likes this.