Unity Random.Range
When you are trying to choose a random number or option of something, you have to use Random.Range. The way random.range works is that you have to write "random.range[x, y]". X represents the lowest number you want to pick and Y is the highest. Then C sharp will pick a random between X and Y. eg. speed = Random.Range[1, 5]. Then you could set a variable to that random number. It's simple as that.

Comments
Post a Comment