I follow the steps in the offical unreal engine docs for line trace by channel but my lines are go to only one point not follow the crosshair.
This should be *
(multiply), not +
(plus).
Everynone is correct about the multiply vector by a float.
Also, if you are using a third person character and are wanting to fire a line trace at a cross hair situated perfectly in the center of screen from your character you need to use two line traces…
One starting from the character or gun muzzle ending at a point specified by the second line trace drawn from the center of the viewport forward to a distance of your choosing.
I object… to the whole thing…
That’s not a cursor. That’s the camera.
And you are assuming that the camera forward vector is where the cursor is.
Not all games have things set up that way…
I object, too! No one has been talking about cursors! Order!!!
I’m going to ignore the fact that this would draw the crosshair on top of the character, making it useless anyway. If this is for a 3rd person press F to interact with what you’re looking at, perhaps offset the camera over the shoulder/to the side a bit?
I see your objection, and I did totally miss read the title
Still. Get hit result under cursor - if you needed that - does the whole thing for you.
And usually
This is why you may choose to have the cursor/crosshair be elsewhere…