help script not working

i had this working on my menu then it just stopped changing colors ,do i need something besides the text and background help me

function OnMouseEnter() 
{ 
//change the color of the text
 renderer.material.color = Color.green; 
}

function OnMouseExit() 
{ 
//change the color of the text
renderer.material.color = Color.white; 
}

1 Answer

1

By 'menu' do you mean a GUI-based menu? In which case using GUIStyle is your best bet. What you have here would change the color of any object that has this script and a collider on it.