- Home /
Excluding values from a Random.range?
Hello. If you are using Random.range to generate values, is there any way to exclude some values within the range (for example: pick a number between 1 and 20, but not 6 through 8)? Thanks
Comment
Best Answer
Answer by Jesse Anders · Dec 29, 2010 at 12:54 AM
The Random class doesn't have any built-in support for this, no. But, you can easily write your own code to achieve the same behavior (the details will depend on the context of course).
Your answer
Follow this Question
Related Questions
Disreguard random number after use... 3 Answers
Random object, Array index out of range 0 Answers
Unity crashes after I change 1 symbol in code! 1 Answer
random range for gui button 1 Answer