how to generate a random float between 0 and 1 in c# code example
Example 1: c# random float between two numbers
//Notice that I think in order to use System.Random you need to import System (using System;)
static float NextFloat(float min, float max){
System.Random random = new System.Random();
double val = (random.NextDouble() * (max - min) + min);
return (float)val;
}
Example 2: c# get random between 0 and 1
double test = random.NextDouble();