Random.Range

Hello i have problem! I newly discovered Random.Range. But when i use it in my code it gives me an error that says: Random' does not contain a definition for Range’

here is my code please help! (:

int randomNumber;

	void Update ()
	{
		if (Input.GetKeyDown (KeyCode.R)) {
			randomNumber = Random.Range (0, 2);
			print (randomNumber);
		}
	}

I’m betting that you called your script Random.cs? Which means your “Random” class is overriding the definition of the UnityEngine.Random class. Solution? Rename your script.