I am making a shooting game where the mouse moves the aiming crosshair and the targets are using OnMouseDown() to detect when they are hit. I coded the crosshair movement for joysticks but of course OnMouseDown() will not work when using a joystick. Does anyone have any ideas that can help me get the hit detection working? I do not think raycast will work because I am using a perspective camera and the crosshair does not stay at the center of the camera, but maybe I am wrong with this assumption. (Similar games would be Lethal Enforcers, Virtua Cop, House of the Dead)
Screenshot: The white circle is the cross hair and the white boxes are the targets. The ray can hit the boxes near the center but not the boxes further away. Probably due to perspective.