OnMouseOver is not working properly?

I have objects in my scene that detect when the mouse is over their collider. All the objects are exactly the same. It works when I am close enough to the object but when it is too far away it doesn’t detect the cursor. They have huge colliders on them so I don’t think the problem has to do with the size of those. Any ideas for why this could be?

Do you have your mouse locked to the centre of your screen? I’ve had problems with that in the past but if not then it’s probably best to do a raycast or spherecast from a camera. It will give you more options later on.

check there for more info on how to use them. If you want to detect for an infinite distance you can set the distance of the raycast very high, higher than you’ll ever need - or perhaps someone else knows a way of carrying it on forever (might kill your cpu though)