i want to be able to create a random number in c#.I am new to the programming language.
What is wrong with this code?
using UnityEngine;
using System.Collections;
public class randomnumbertest1 : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void Rand() {
Random rnd = new Random();
int num = rnd.Next(1,6);
Debug.Log (num);
}
}