How to shoot ray in specific direction? Top-down shooter

This works perfectly:

What I think you may be having a problem with, is the difference between the crosshair and the mouse cursor. To see the mouse cursor during gameplay, you have to type ‘SHIFT F1’.