Random Number Script

Hey, i know how to get a random on the click of a button and then have it change the text for a text box

  int randomNum = Random.Range(1, 4);

        if (randomNum == 1)
        {

            TextBox.text = AryOne[0];
// etc
        }

the only problem im having with this is no matter how many times i press the random number button i never get randomNum == 4 but if i make the range 4,4 then i always do obviously just something a bit strange. Anyway to solve this i was thinking of having it so once once randomNum has been one of the numbers it cant be that number again until all the other ones have been picked and then it goes back to being random

Take a look at the docs for it which states how the Random.Range int overload works.

From the docs: “so for example Random.Range(0, 10) will return a value between 0 and 9, each with approximately equal probability.” so in your case you’ll get 1 to 3.