- Home /
How to use random numbers?
Alright so I just want a random number between 1 and 100. In JavaScript please. Thanks!
Comment
Answer by aldonaletto · Jan 15, 2012 at 04:45 PM
If you want integer numbers, use Random.Range(1, 101) - this will return integers between 1 and 100 (1 and 100 included). If you want a float, use Random.Range(1.0, 100.0) - the value returned is between 1 and 100 (both values included):
var rndNum: int = Random.Range(1, 101);
Your answer
Follow this Question
Related Questions
Picking one of two numbers. 1 Answer
Excluding values from a Random.range? 1 Answer
Random number on game start for a variable 1 Answer
Disreguard random number after use... 3 Answers
Random.seed on different hardware? 1 Answer