# Line Trace is off from CrossHair

**URL:** <https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735>\
**Category:** UI\
**Tags:** crosshair, linetrace, unreal-engine, nodes, Blueprint, question\
**Created:** [September 2, 2020, 11:07pm UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735 "2020-09-02T23:07:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jock\_Mills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jock\_Mills](https://forums.unrealengine.com/u/Jock_Mills)\
**Post date:** [September 2, 2020, 11:07pm UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/1 "2020-09-02T23:07:08Z")

</div>

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?

 ![312228-linetraceissue.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/f/8/3f89042be872fd21ee801d7ca804e1541fb98b14.jpeg)

---

<div class="post-metadata">

**Author:** ![Tuerer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tuerer/32/1008648_2.png) [@Tuerer](https://forums.unrealengine.com/u/Tuerer)\
**Post date:** [September 2, 2020, 11:19pm UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/2 "2020-09-02T23:19:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Marcis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/marcis/32/1103070_2.png) [@Marcis](https://forums.unrealengine.com/u/Marcis)\
**Post date:** [September 3, 2020, 12:26am UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/3 "2020-09-03T00:26:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Okarii](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Okarii](https://forums.unrealengine.com/u/Okarii)\
**Post date:** [September 3, 2020, 12:28am UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/4 "2020-09-03T00:28:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jock\_Mills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jock\_Mills](https://forums.unrealengine.com/u/Jock_Mills)\
**Post date:** [September 11, 2020, 8:01pm UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/5 "2020-09-11T20:01:56Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Jock\_Mills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jock\_Mills](https://forums.unrealengine.com/u/Jock_Mills)\
**Post date:** [September 15, 2020, 8:48pm UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/6 "2020-09-15T20:48:53Z")

</div>

_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.

---

<div class="post-metadata">

**Author:** ![DonBusso](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DonBusso](https://forums.unrealengine.com/u/DonBusso)\
**Post date:** [September 15, 2020, 9:52pm UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/7 "2020-09-15T21:52:16Z")

</div>

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.

 ![313728-bp-graph.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/1/2c146bbd7bcbedc26cbb68fc6fdb2334ff0dff52.png)

 ![313727-crosshair-widget.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/4/4/144b9b9e5bc6d56c96fbc5e565f24460b34c26bb.png)

![313729-crosshair-image.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/6/0e62d92db18c9a5629ff07a85d30d54d1977b41a.png)

---

<div class="post-metadata">

**Author:** ![Jock\_Mills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jock\_Mills](https://forums.unrealengine.com/u/Jock_Mills)\
**Post date:** [September 15, 2020, 10:30pm UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/8 "2020-09-15T22:30:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jock\_Mills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jock\_Mills](https://forums.unrealengine.com/u/Jock_Mills)\
**Post date:** [September 17, 2020, 10:39pm UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/9 "2020-09-17T22:39:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DonBusso](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DonBusso](https://forums.unrealengine.com/u/DonBusso)\
**Post date:** [September 17, 2020, 11:01pm UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/10 "2020-09-17T23:01:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jock\_Mills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jock\_Mills](https://forums.unrealengine.com/u/Jock_Mills)\
**Post date:** [September 18, 2020, 12:35am UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/11 "2020-09-18T00:35:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DonBusso](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DonBusso](https://forums.unrealengine.com/u/DonBusso)\
**Post date:** [September 18, 2020, 1:17am UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/12 "2020-09-18T01:17:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jock\_Mills](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jock\_Mills](https://forums.unrealengine.com/u/Jock_Mills)\
**Post date:** [September 18, 2020, 5:49am UTC](https://forums.unrealengine.com/t/line-trace-is-off-from-crosshair/470735/13 "2020-09-18T05:49:54Z")

</div>

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