ray sensors,grapple

hi there, i hope im in the right section, i have a cube with a y axis ray sensor and a drawline so i can see where it is going and it reacts to a mouse click to move towards a point, basically it is a grapple and it works fine, but what i would like, is if i click somewhere on the screen the ray sensor goes to that point “no mater the angle” and the player moves to it,not just straight forwards. any help on this matter would be very helpful. thank you