Operator Modal View3D Raycast Template

Can someone help me determine why the python template “operator_modal_view3d_raycast.py” doesn’t work when in orthographic view?

If you open the text editor space then load the operator_modal_view3d_raycast.py that is shipped with Blender. The example shows you how to cast a ray into 3D space to select the object that your mouse is hovered over. This script works flawlessly when in perspective mode, but when in orthographic mode it is unreliable. Sometimes it will work, but most times it doesn’t find the object.

Any help on this would be appreciated.

Possibly because it uses raycasting, which is always in perspective 3d? In ortho view, there is no depth. We might need to use a different approach to find the right object.