When I place these mouse input handler methods on a RawImage, none of them will run. I’ve followed tutorials and tried the Unity API versions. The PointerEventData is always null too.
I have a cursor overlay, so i’m sure im clicking the image, and the debug messages won’t play. Here is a sample of the script that won’t work:
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;// Required when using Event data.
public class DragTest : MonoBehaviour, IPointerDownHandler// required interface when using the OnPointerDown method.
{
//Do this when the mouse is clicked over the selectable object this script is attached to.
public void OnPointerDown(PointerEventData eventData)
{
Debug.Log(this.gameObject.name + " Was Clicked.");
}
}
Nobody else seems to have this problem and I have no idea what could be causing it. Does anyone know if this script automatically picks up on the image its attached to?
Thanks in advanced