I updated my project from 2019 LTS to 2022.3 LTS to build my game for Android with the newest API. My game was working with OnMouseDown(), but when I upgraded to 2022, OnMouseDown was not registered.
I found out why OnMouseDown or IPointerClickHandler was not working on 2022.3.41.f1. I forgot that when I updated my project, the input was switched to the new Unity Input System, and hence, OnMouseDown does not get called like before. IPointerClickHandler only works with UI, and in order to work on a 2D or 3D object, you need to add a Physic Raycast component to the Camera to make it work.