# Help with line trace inaccuracies

**URL:** <https://forums.unrealengine.com/t/help-with-line-trace-inaccuracies/457711>\
**Category:** Blueprint\
**Tags:** debug-trace, unreal-engine, UE4, Blueprint, question\
**Created:** [October 29, 2019, 1:17pm UTC](https://forums.unrealengine.com/t/help-with-line-trace-inaccuracies/457711 "2019-10-29T13:17:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hubey808](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hubey808](https://forums.unrealengine.com/u/Hubey808)\
**Post date:** [October 29, 2019, 1:17pm UTC](https://forums.unrealengine.com/t/help-with-line-trace-inaccuracies/457711/1 "2019-10-29T13:17:24Z")

</div>

I attempt to view debug line trace in my scene with major inaccuracy. Thinking it may be something with my scene, I have tried the same blueprint in FirstPersonExampleMap under the FirstPersonCharacter blueprint. When I use the Interact key (E) my traces are nowhere near my target.

I (hope) I have listed the three images, one being the blueprint, one being the target and the last being the trace. Note on the trace I’ve had to back up just to view and it appears to be shooting backwards and up towards the sky.

---

<div class="post-metadata">

**Author:** ![Bojann](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bojann/32/906560_2.png) [@Bojann](https://forums.unrealengine.com/u/Bojann)\
**Post date:** [October 29, 2019, 1:27pm UTC](https://forums.unrealengine.com/t/help-with-line-trace-inaccuracies/457711/2 "2019-10-29T13:27:56Z")

</div>

Your start location should be, for example, CameraWorldLocation.  
End should be Start + Camera → ForwardVector() \* length of the raycast you want to use.

I know this is C++, but you can use it as reference. I used it in my game to make my AI Car shoot at enemies. Note: this is pseudo code in order to help you read it.

```
FVector Start = Machinegun->GetComponentLocation();
FVector End = Start + (Machinegun->GetForwardVector() * AimSightLength);
```

---

<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:** [October 29, 2019, 1:53pm UTC](https://forums.unrealengine.com/t/help-with-line-trace-inaccuracies/457711/3 "2019-10-29T13:53:11Z")

</div>

Instead of adding 500 to forward vector you should multiply by 500.

---

<div class="post-metadata">

**Author:** ![Hubey808](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hubey808](https://forums.unrealengine.com/u/Hubey808)\
**Post date:** [October 29, 2019, 11:36pm UTC](https://forums.unrealengine.com/t/help-with-line-trace-inaccuracies/457711/4 "2019-10-29T23:36:40Z")

</div>

Switching the (Vector + Float) to the (Vector \* Float) solved the issue. Thanks for the input!
