I implemented the IPointerClickHandler in a script that runs on multiple GameObjects in my scene. I'm definitely missing something since the implementation is not being called at all. The objects are not UI elements. Here is the implementation of the interface :
public void OnPointerClick(PointerEventData eventData)
{
Debug.Log("clicked on " + eventData.selectedObject.name);
}
Can I even use the EventSystem with normal GameObjects? If I can how do I do it.
What i tried: Adding a BoxCollider2D to the object, using the event trigger component on the object calling a public method.
Edit: I was missing a raycaster on the main camera.