OnMouseEnter not working?

So I’m making a main menu for a game and when you hover the mouse over a UI image, a panel should open explaining what the specific item related to the image does. I’ve attached the script to the photo, but it seems to be not working at all. My code looks like this:

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
    
}

private void OnMouseEnter()
{
    Debug.Log("its on");
    text.SetActive(true);
}
private void OnMouseExit()
{
    text.SetActive(false);
}

does anyone know how to fix it?

using UnityEngine;
using UnityEngine.EventSystems;
public class PointerExample : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public void OnPointerEnter(PointerEventData eventData)
{
Debug.Log(“OnPointerEnter”);
text.SetActive(true);
}
public void OnPointerExit(PointerEventData eventData)
{
Debug.Log(“OnPointerExit”);
text.SetActive(false);
}
}