OnMouseDown detection doesn't work at high speeds

I am creating a game where you are in a mini 2D solar system, and I am making it a survival game in a way, so I have a thing setup where clicking on things like bushes or trees is how you damage them to destroy them. I have OnTrigger colliders on all the destroyable objects, and an OnMouseDown to determine if they’re clicked on. When my planets are stationary it works but depending on the speed of the planet’s orbit sometimes clicks just don’t register. I feel like it probably has to do with the collider moving too far in-between frames or something, but I do not know.

For clicking on small fast-moving objects you may need to assist the user by:

  • listening for the click
  • checking the click against the object in its current, and perhaps a few frames previous positions

Sometimes the above can be easier if you do the comparison yourself in screenspace, rather than relying on a raycast:

  • convert the planet in question position to screenspace
  • compare that to the mouse position
  • if it is close enough, consider it a click