OnMouseEnter and or renderer not working?

Hey guys,

So I downloaded this font 28 Days Later Font | dafont.com and I used it to make 3D text in the game. I added a box collider to the text, and then I made a script using the C# code found here Unity - Scripting API: MonoBehaviour.OnMouseEnter(), added it to my 3D text, and it didn’t work, as in it did not change the text to red when my mouse hovered over the text. What am I doing wrong? Why doesn’t it work?

It helps to post the code :smile:

  1. Create a 3D Text
  2. Add a box collider
  3. Add the following script
  4. Enjoy (:
public class MouseEnterTest : MonoBehaviour {
	
	void OnMouseEnter() {
		Debug.Log("on the 3d text");	
		GetComponent<TextMesh>().font.material.color = Color.red;
	}
	
	void OnMouseExit() {
		Debug.Log("left the 3d text");
		GetComponent<TextMesh>().font.material.color = Color.white;		
	}
}