Hi am doing a tutorial https://unity3d.com/learn/tutorials/modules/beginner/scripting/scripts-as-behaviour-components?playlist=17117
void Update () {
if (Input.GetKeyDown(KeyCode.R)) {
gameObject.GetComponent().materials = red;
}
if (Input.GetKeyDown (KeyCode.G)) {
gameObject.GetComponent().materials = green;
}
if (Input.GetKeyDown (KeyCode.B)) {
gameObject.GetComponent().materials = blue;
}
}
}
and in the console I get
error CS0103: The name 'Red' does not exist in current context can anyone help with the current scripting
↧