Why does the usual C # Random not work in a Unity script?
I try this code to change the color channel at the touch of a button:
void Update () { Random rnd = new Random(); if (Input.GetKeyUp (KeyCode.Space)) { byte value = rnd.Next(); } Color32 color32 = new Color32(4, 128, 192, value); obj.GetComponent <Renderer> ().material.color = color32; } Also, I do not understand how to set the interval in which generation will occur.