renderer colour change not working.

Hi all, I have used this code before to change the colour of 3d text when hovering over it.

function OnMouseEnter () {
        renderer.material.color = red;  
}
function OnMouseExit () {
                renderer.material.color = green;

}

However for some reason this time it is not changing colour. I am getting a collision message from the mouse when hovering over it using `print("collide");` so it must be something to do with the way I am calling the colour change. This is occuring on an escape menu so I am using renderer.enabled = true to make the menu appear. I don't know if this is related but I thought I would throw that in there.

Any ideas would be greatly appreciated. Thanks

this is your problem :

 function OnMouseEnter () {

renderer.material.color = Color.red; 
 }
    function OnMouseExit () {
            renderer.material.color = Color.green;

    }

you forgot to put the Color call after the equals :)

AHA! Fixed it . it was an if loop that said if var a was true then the render color would be green. this was overriding the color change later in the script.