- Home /
How do I generate a "random" number from a seed?
I am trying to generate a pseudo-random number from a seed number. In my case Network.time is the seed from which I want to derive this "random" number. And I need the random number to be between 0 and 100.
Why?: Because it represents a player's chance to automatically dodge an incoming attack in a networked game, without me actually having to send any message over the network, I just use a seeded value using Network.time to produce seemingly random dodging that will automatically sync up on each client.
Answer by dsada · Sep 13, 2014 at 09:38 PM
Random.seed = Network.time;
int random = Random.Range(0,101);
Your answer
Follow this Question
Related Questions
Randomly generated number 0 Answers
Random.Range(..) not working 1 Answer
How to call a user input variable in another script. 1 Answer
Adding GUI to this 1 Answer
Recording and playback of gameplay using events (NOT video) 1 Answer