I just found this out today, Unity’s Random class has the same name as .net’s System.Random class. So if you are using System and try to use Unity’s random functions, you get an error.
Was it intended to have the same name? Because that is weird and causes problems.
Thanks,
-Jeremy
The two classes are in separate namespaces. You’ll just have to fully qualify the name of the classes:
UnityEngine.Random.value;
new System.Random();
In C# you can also import both by renaming them with the using statement:
using URnd=UnityEngine.Random;
using SRnd=System.Random;
// ...
URnd.value;
new SRnd();