While viewing this video it dawned on me to use a mouseOver event.
I haven’t finished it at all only tested that it works when mouse is over.
My question is would this approach lead to worse preformance?
Hers the script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseOverPopUps : MonoBehaviour
{
[SerializeField] string popUpMessage = "Enter text caption for this popup";
void OnMouseOver()
{
//If your mouse hovers over the GameObject with the script attached, output this message
Debug.Log($"Mouse is over GameObject: {this.name} and its tag is {this.gameObject.tag}");
}
void OnMouseExit()
{
//The mouse is no longer hovering over the GameObject so output this message each frame
Debug.Log($"Mouse is no longer on GameObject: {this.name} and its tag is {this.gameObject.tag}");
}
}
Thanks for feedback