Line Trace is off from CrossHair

So i made a line trace and it works but the line is lower then my cross-hair? i was trying to see if there is away to get the location of the cross hair and connect to the LineTracebychannel? i started some nodes off “Create Hud Widget” >crosshairRef>Get cached geometry>local to view port??? did not know where to go from there??? unless there is another way to solve this problem?

Are you using the default first person template? IIRC, the default crosshair there is not in the center of the screen, it is offset a bit to better represent where the ball will be shot.

After you multiply by 200 you should add world location not multiply by it.

This is correct. both the first person and the third person default templates the crosshairs are not centered on screen.

I think i started as a First Person then slowly converted to a third person. so how would i be able to get the cross hair lined up right with the firing?

You can make a crosshair widget with image anchored to middle of the screen and then just run a line trace of your camera. Attaching crosshair image if you need one. You can control the color of your crosshair using tint, manually or via blueprints if you want more then one color.

313729-crosshair-image.png

1 Like

Bump
Still need help figuring this out.
When my character fires his bullet i want it to line up with the cross hair i made.

my character haves his weapon attached to him and haves a socket where he fires from with pre made bullets and pre made cross hair already.

what other node would you use besides “cast to” since i am using my character? sorry i am still learning blueprints at the moment.

If you’re already inside your character blueprint then you don’t need to cast to it again to get access to it’s variables. You can simply grab “First Person Camera” component and drag it onto the graph and the rest is exactly the same.

OK…so i got that to work!. but now how do i get my, “SpawnActor” Node “Bullets” in to that equation so the bullets line up with the crosshair?? at the moment there shooting above the crosshair.

Spawn the bullets in the middle of the screen, you can use your camera for that too. Show how you spawn the bullets.

even if the character is in third person view? cause i already have a socket on his gun.