From the frequency of the user's keystrokes or mouse movement when the program is launched or when the game begins.From the system clock when the program is launched or when the game begins.This seed can come from different sources: If you are just writing Random.Range(0, 10), Unity is using some built-in seed to generate the number. You always need a seed to start the algorithm. But with pseudo random numbers you will be able to generate the same sequence of random numbers because you are using a so-called seed. Another property of a true random number is that nobody should be able to reconstruct the sequence at a later time. One of properties of a true random number is that you shouldn't be able to find a pattern between the numbers. Print(Random.Range(0, 10)) //returns 9 every time Print(Random.Range(0, 10)) //returns 6 every time Random.InitState(12345) //This is the seed Generating pseudo random numbers in Unity is easy.
0 Comments
Leave a Reply. |