Hi,
I have a prefab that I instantiate at a point in my game. The script attached to the prefab has the public void OnPointerDown(PointerEventData eventData)
function implemented. Now when the prefab is dragged into the scene manually (before the game is run), the click event is registered. However when the prefab is instantiated during runtime, the click event is not registered. What could be the problem?
Try to add print() or Debug.Log()
using UnityEngine.EventSystems;
...
public void OnPointerDown(PointerEventData eventData){
Debug.Log("OnPointerDown Event Work");
//Your code
Debug.Log("OnPointerDown Event Work. Your code too");
}