Well… The title explains…
Here’s the code:
function Update () {
gameObject.renderer.material.color = Color.red;
}
Here’s the error. I just put the script on a standard Unity Cube.
NullReferenceException: Object reference not set to an instance of an object
Color.Update () (at Assets/Color.js:2)