so i followed a tutorial from youtube and i made this Script:
using System.Collections;
using UnityEngine;
using UnityEngine.EventSystems;
using System;
using UnityEngine.UI;
public class ItemSlot : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
private Item _item;
public Item Item
{
get { return _item; }
set
{
_item = value;
if (_item == null)
{
image.enabled = false;
}
else
{
image.sprite = _item.Icon;
image.enabled = true;
}
}
}
[SerializeField] Image image;
[SerializeField] ItemToolTip tooltip;
protected virtual void OnValidate()
{
if (image == null)
image = GetComponent<Image>();
if (tooltip == null)
tooltip = FindObjectOfType<ItemToolTip>();
}
public void OnPointerEnter(PointerEventData eventData)
{
Debug.Log("Slot Detected!");
if (Item is EquippableItem)
{
tooltip.ShowTooltip((EquippableItem)Item);
}
}
public void OnPointerExit(PointerEventData eventData)
{
Debug.Log("You Exit");
tooltip.HideTooltip();
}
}
my problem is that it is not detecting the OnPointEnter method and i am not getting my Debug:log if i hover with my mouse above my “Slot” object