OnMouseEnter, change color.

Hello guys.
So, I’m just playing around in Unity (god, it’s so fun when you know even the tiniest bit of scripting), so I was trying to make a main menu.
I usually just go with GUI.Button which is great but this time I wanted to make it different, based OnMouseEnter, so I looked it up, searched a bit, somebody said that I will need to use “OnMouseExit, OnMouseDown” and so, which is like GetButtonDown, I think , at least for me.


Anyways, here is the script.

public class mainMenu : MonoBehaviour {

	void OnMouseEnter ()
	{
		renderer.material.color = Color.red;
	}

	void OnMouseExit ()
	{
		renderer.material.color = Color.black;
	}

	void OnMouseDown ()
	{
		Application.LoadLevel (1);
	}


}
Now, there is nothing wrong with the code, true but when my mouse gets on the 3D Text, the color is not changing, why?

Yes, there is a collider with the box “On Trigger” checked.

Ok, I fixed it.So I managed to get it working by just making the text color white and declaring in the start function that, “Hey, the text’s color is black, not white”.Works like charm now.