Changing Gameobject Color

Hi, I’m just trying to change the color of a gameobject.

I’ve tossed this into the update section of the code: GetComponent().material.color =;

And am now getting this error: Assets/Scripts/gameobjectColor.cs(10,57): error CS0117: Color' does not contain a definition for black’

I’ve tried a lot of things and I just can’t wrap my around why changing the color of a gameObject is so difficult, I am completely new to scripting / programming.

The code in its entirety is listed below.

using UnityEngine;
using System.Collections;

public class Color : MonoBehaviour

// Use this for initialization
void Start()
    GetComponent<Renderer>().material.color =;


You’ve called your class “Color”, which conflicts with the definition of the built-in color class. Call your file (and the class definition inside it) something else.