When I hover over a button (the button changes position on hover) in the Editor Player, OnPointerEnter and OnPointerExit work. When I build the game and go and hover over the button it doesn't work. I've enabled Raycast Target and I have no idea how to fix this.
here is the code
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class CardUp : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
private Vector2 normalPos;
void Start()
{
normalPos = gameObject.GetComponent<RectTransform>().position;
}
public void OnPointerEnter(PointerEventData eventData)
{
LeanTween.move(gameObject, new Vector2(normalPos.x, normalPos.y + 150), 0.3f);
}
public void OnPointerExit(PointerEventData eventData)
{
LeanTween.move(gameObject, new Vector2(normalPos.x, normalPos.y), 0.3f);
}