OnMouseOver not called for fast mouse movements

OnMouseOver() is not called if you move the mouse quickly enough over an entire GameObject. This makes sense as the mouse events are likely coming from the OS (Windows in my case) and run at some fixed rate.

I was wondering if there was an easy/built-in way to “interpolate” the mouse if it moved a large distance in a given frame. I can see how it would be possible to compare currentMousePos with prevMousePos and interpolate along that vector with smaller steps, but I can’t think of an easy way to then fire an OnMouseOver event.

Would I would need to maintain a list of whatever I wanted to check mouse over events for and manually do this check?


Mouse movement updates are sent from operating system, on unity part you may of course write/extend/overtide your own events system, it’s hard but doable. Although I suggest you to try different approach to intercept events. OnMouseOver is an old style, try to use EventSystem interfaces: IPointerEnterHandler and IPointerExitHandler, they may be more precise.