# Line trace in wrong direction

**URL:** <https://forums.unrealengine.com/t/line-trace-in-wrong-direction/440358>\
**Category:** Character & Animation\
**Tags:** sockets, line-trace, rotation-direction, unreal-engine, question\
**Created:** [December 31, 2018, 12:06pm UTC](https://forums.unrealengine.com/t/line-trace-in-wrong-direction/440358 "2018-12-31T12:06:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hallonsaft](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hallonsaft](https://forums.unrealengine.com/u/Hallonsaft)\
**Post date:** [December 31, 2018, 12:06pm UTC](https://forums.unrealengine.com/t/line-trace-in-wrong-direction/440358/1 "2018-12-31T12:06:46Z")

</div>

I shoot a run of the mill line trace from a socket on my weapon but something is causing it to offset when I play in another map.

On one map it works as intended, shoots straight from where the weapon is pointing, however changing to another level it breaks down. The line trace is offset to one direction, however when I rotate the player it’s offset in another direction.

Any ideas what might be causing this?

 ![263698-3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/0/9b0f478a2b5f3c5ce57117d5cd37616a07506fd4.png)

 ![263700-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/1/441a2211a409a0a010b58286f09cc98f86012b0e.png)

---

<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:** [December 31, 2018, 12:28pm UTC](https://forums.unrealengine.com/t/line-trace-in-wrong-direction/440358/2 "2018-12-31T12:28:45Z")

</div>

For the Trace End, you have to add the Vector x 10000 to the muzzle location, otherwise you’re calculating the end from the world origin 0,0,0, and not from the muzzle location.

---

<div class="post-metadata">

**Author:** ![Hallonsaft](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hallonsaft](https://forums.unrealengine.com/u/Hallonsaft)\
**Post date:** [December 31, 2018, 5:04pm UTC](https://forums.unrealengine.com/t/line-trace-in-wrong-direction/440358/3 "2018-12-31T17:04:16Z")

</div>

Thank you, it works great now
