Renderer and Color are unknown to unity. Why?

When I write or download a script things like ‘renderer’ and ‘color’ are coming up with errors once loaded into unity.

Example:

function OnMouseEnter()

{

renderer.material.color = color.white ;

}

This then in unity it says ‘unknown identifier color’ / ‘unknown identifier renderer’. Sometimes this error appear using other identifiers. I’m using Free Unity 3D 3.5.5f3.

Lower case is typically when you want to access the member, and Uppercase is when you want the actual class.

In the case of the color on the right hand side of the statement, it should be Color.white since you’re trying to access the white member of the class Color.

As for the renderer not being recognized, not quite sure.