Hi

I have a small question, what is the benefit of the variable ‘seed’ in class ‘random’ (Random.seed)?

I hope some one give me an example…

If you set the seed, then calling Random after that gives you a repeatable set of “random” numbers. Setting Random.seed to 5, for example, and then doing Random.Range(0, 10) three times will always result in the sequence 4, 3, 5 no matter what. Different seeds result in different sequences.

Random numbers aren’t actually random, but are the result of a mathematical calculation. Technically there’s still a seed even if you don’t set it, but it’s based on something relatively unpredictable, like the exact time the app was started (or something along those lines). So if you don’t set the seed, then Random does generate numbers that are reasonably random enough for most intents and purposes. (Although Unity 3 uses a different algorithm that results in better randomness.)

–Eric

Thanks Eric for clearing …