# How can I get OnMouseEnter to trigger on a 3D Text in Unity3D?

I've just started to learn Unity3D.

I want to create a simple 3D menu with just two 3D Text instances. I've created and named them, then dropped this script:

function Awake(){
}
function OnMouseEnter(){
print("OnMouseEnter " + gameObject.name);
}
function OnMouseDown(){
print("OnMouseDown " + gameObject.name);
}


I only see the init/awake message printed in the console.

What am I missing ?

EDIT:

Sorry, I forgot to add the BoxCollider(Physics>Box Collider) to my object, so no events were triggered.

First make sure that everything else is set up correctly.

In a different script that's running somewhere, put in this bit of code (C#, and from memory so it may not be 100% accurate):

RaycastHit hitInfo;
if( Physics.Raycast( Camera.main.ScreenPointToRay( Input.mousePosition ), out hitInfo ) )
{
Debug.Log( "mouse is over object " + hitInfo.collider.name );
}


If that doesn't work then you probably don't have your colliders set up correctly. If it does print out something then you have something else messed up.