if above mention things are not working then try to increase the size of box collider 2d if you see there is warning like “collider did not create any collision…” In box collider2d component.
I was missing a PhysicsRaycaster on my camera…
I had the same problem, but I fixed it by adding more handlers to my code (even when I don’t use those handlers but only having their methods too).
The not working line:
public class ClassName: MonoBehaviour, IPointerClickHandler
How it fixed it:
public class ClassName: MonoBehaviour, IPointerClickHandler, IPointerUpHandler, IPointerDownHandler
It looks like using those other handlers makes the camera/project/idk to recognize the clicks.
I actually had the same problem in my android project, i already added the interface, collider and physics raycaster, but it did not work at the editor. After I build and run into real device, it works. I don’t know what happens
You should know, every “click, press etc” events are called only once on same gameobject but not parent
Lets say you have this hierarchy and all of them are Images with scripts
Script1 - OnPointerClick, OnScroll
→ Script2 - OnPointerClick
----> Script3 OnScroll, Script4 OnScroll
If you have this hiearchy and you click on that gameobject with script3 it will look up and find script2 with OnPointerClick and stop here.
If you Scroll it will find on Script3 and on Script4 and will execute both but not the OnScroll in Script1.
If you have something like that then this could be the problem.