Crosshair offset from center - how to get accurate trace to crosshair exactly

I have been experimenting with offseting crosshair from center of the screen, to another position.

Here is blueprints:

https://dl.dropboxusercontent.com/u/70400220/Unreal-questions/crosshair-offset-blueprint.png

And here is the issue:

https://dl.dropboxusercontent.com/u/70400220/Unreal-questions/crosshair-issue1.jpg

https://dl.dropboxusercontent.com/u/70400220/Unreal-questions/crosshair-issue2.jpg

https://dl.dropboxusercontent.com/u/70400220/Unreal-questions/crosshair-issue3.jpg

Does anyone have any idea how to get correct value for end trace, so it will match crosshair exactly ? Or maybe someone have another idea how to approach it. What I need essentialy is crosshair offseted from center of the screen, and then trace which will hit exactly at crosshair location.

You should use the the ‘World Position’ pin-out from the Deproject node as the starting point of the line trace, and the ending should be World Position from Deproject plus its direction times some value.

Start = Deproject’s World Position
End = (Deproject’s World Position) + (Deproject’s World Direction * 100000)

1 Like

First of you should put the default crosshair to -8,-8 since its 16x16 and the default hud renders its to the middle of the screen

afterwards you should start your trace at your cameras position

should be in the middle then

Thanks. That solved the issue.

I have the same issue, and I can’t see the images, so I don’t really know how do adapt this to my blueprints

Could you specify, please?