Random' is an ambiguous reference between UnityEngine.Random’ and `System.Random’
I am attempting to create a variable with a value between 1 and 20. I set it to private.
int _variable=Random.Range(1,20);
but when I put it into a gui label, it spits out the above error.
I have:
using UnityEngine;
using System.Collections;
using System;
At the top. What am I missing???
Thanks!
just add this line:
using Random=UnityEngine.Random;
well just explicity choose which one you want to use and write
int _variable=System.Random.Range(1,20); OR
int _variable=UnityEngine.Random.Range(1,20);
honestly I do not know which one you should use, but I guess is the second one (just checked, it is the second one
)
esto es viejo jaja pero mi conclusion que encontre esque System Y UnityEngine tiene diferentes funcion cada una del Random… por lo que si usas la classe inicial de UnityEngine y System va a chocar y pide que cual exactamente quieres usar por lo que antes se deberia poner el UnityEngine.Random.Range(x,y) y asi