GUIText not firing OnMouseOver

Hello,
I’m using Unity since a week in the 2D mode.

I’m trying to add mouse event listeners for a GUIText. I’ve attached a script to each GUIText in my scene but that doesn’t seem to work…

Do you have any idea ?

*I’ve included my C# script and a screen capture of the actual setup in unity.

using UnityEngine;
using System.Collections;

public class HUDItemController : MonoBehaviour
{
  void  OnMouseOver () {
    Debug.Log ("mo");
  }
 
  void OnMouseUp () {
    Debug.Log ("mu");
  }
  
  void OnMouseEnter () {
    Debug.Log ("me");
  }

}

It works on my end, but I made some quick changes to effectively demonstrate that.

   bool over, up, enter;
    void OnMouseOver()
    {
        if (!over)
        {
            Debug.Log("mo");
            over = true;
        }
    }

    void OnMouseUp()
    {
        if (!up)
        {
            Debug.Log("mu");
            up = true;
        }
    }

    void OnMouseEnter()
    {
        if (!enter)
        {
            Debug.Log("me");
            enter = true;
        }
    }

If you test this code, you will see that it works, your problem was that the OnMouseOver() was spamming the console and you were not able to see when it showed the other states.