# Confused regarding Line Traces from a stored location

**URL:** <https://forums.unrealengine.com/t/confused-regarding-line-traces-from-a-stored-location/132887>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [November 2, 2019, 10:31am UTC](https://forums.unrealengine.com/t/confused-regarding-line-traces-from-a-stored-location/132887 "2019-11-02T10:31:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Memo223](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Memo223](https://forums.unrealengine.com/u/Memo223)\
**Post date:** [November 2, 2019, 10:31am UTC](https://forums.unrealengine.com/t/confused-regarding-line-traces-from-a-stored-location/132887/1 "2019-11-02T10:31:38Z")

</div>

I recently came around to try and develop my own Melee Combat system and everything was working smoothly untill i came to making a correct line trace. Even though i already have a way to create a line trace from a certain socket / scene component it draws the line fine only that it isnt a continuous smooth line from Point A (Start location at that frame) to Point B (New Location at that frame).

Although i found a way that you could have a stored location inside a vector to then if (needed) boost performance from that, but the only issue i had is that i couldnt get it to trace a line using a vector as start and then a Get World Location from the “socket” im using to trace. Meaning i never got the debug line to show, thus i had it on Duration.

Also im trying to find a good way to only trace when i use my actionkey for that certain weapon, i did somehow get it to work earlier with an Event Tick but that obviously continues to fire in the background, and if i were to just use the ActionMapping i would need to hold it down in order for it to draw a line.

Looked around the entire forums for some way or tutorial to make a Chivalry / Mordhau style line trace, but either got vague or no actual info regarding it. Any help or points in right direction would be greatly appreciated.  
The current setup i have just makes the line shoot forward in one direction as i can’t find a way to combine my current setup with “get forward vector”.  
BR

 ![test.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/0/8043e81afbd6305a7d4481703a97a179c8dde819.png)

---

<div class="post-metadata">

**Author:** ![JaredTherriault](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jaredtherriault/32/1194499_2.png) [@JaredTherriault](https://forums.unrealengine.com/u/JaredTherriault)\
**Post date:** [November 2, 2019, 2:15pm UTC](https://forums.unrealengine.com/t/confused-regarding-line-traces-from-a-stored-location/132887/2 "2019-11-02T14:15:38Z")

</div>

So you want to trace a line from the tip of your, let’s say axe, down its forward vector so it’s always tracing out from the blade end?

Create a scene component on the blade of the axe and have its World Location be the Start. The End should be Start + (GetForwardVector of Axe \* desired length of trace in unreal units). This will trace outward from the blade of the axe assuming that the Axe’s blade is facing its X vector.

---

<div class="post-metadata">

**Author:** ![Memo223](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Memo223](https://forums.unrealengine.com/u/Memo223)\
**Post date:** [November 2, 2019, 4:24pm UTC](https://forums.unrealengine.com/t/confused-regarding-line-traces-from-a-stored-location/132887/3 "2019-11-02T16:24:31Z")

</div>

Hey, yes i believe that is what im trying to achieve, i tried to replicate something similar to what you wrote but i guess i did something wrong in the proccess, since i stil only get the trace to face, well in one direction but seperated so it never draws a line that is connected, here is a prime example of what im looking to achieve

 ![3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/f/8f62f64b5f995a81bfaf151d1209ac27988811d3.jpeg)  
Essentially i want to be able to start drawing a line from the stored position, which is the start, to then draw a line in-between the end of the swing (arc) or something similar, im driving my attacks using Character animations and im using the sword in a socket.

---

<div class="post-metadata">

**Author:** ![Memo223](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Memo223](https://forums.unrealengine.com/u/Memo223)\
**Post date:** [November 5, 2019, 11:39pm UTC](https://forums.unrealengine.com/t/confused-regarding-line-traces-from-a-stored-location/132887/4 "2019-11-05T23:39:52Z")

</div>

Alright, ive got a way to make it trace it as i want, only two issues, for one the line trace initially shoots into Vectors 0-0-0, because of the get Box 1 vector, then i have another issue that i need my Trace to only be active once i perform a certain attack. Such as Inputaction slash since im not using this in my character

BP i didnt find a way to do it in my instanced weapon which has the parent “MasterSword” What im trying to achieve is to make it update the required position but also only draw a line trace during an attack and stop after that, but i need it to draw as long as the animation plays, but i can’t do this using AnimTicks or what it is called as i have too many animations.

 ![1.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/1/119b839a6a50e034f0fefd961c379b3143483062.png)  
 ![2.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/0/007bf26098ee887114d379f2ea2c47ec4a805151.png)

---

<div class="post-metadata">

**Author:** ![JaredTherriault](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jaredtherriault/32/1194499_2.png) [@JaredTherriault](https://forums.unrealengine.com/u/JaredTherriault)\
**Post date:** [November 6, 2019, 9:29pm UTC](https://forums.unrealengine.com/t/confused-regarding-line-traces-from-a-stored-location/132887/5 "2019-11-06T21:29:58Z")

</div>

You’re going to have to use the anim notify system to tell your class that the animation has finished unless you want to hardcode a duration.

---

<div class="post-metadata">

**Author:** ![Memo223](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Memo223](https://forums.unrealengine.com/u/Memo223)\
**Post date:** [November 6, 2019, 9:38pm UTC](https://forums.unrealengine.com/t/confused-regarding-line-traces-from-a-stored-location/132887/6 "2019-11-06T21:38:29Z")

</div>

I mean, shouldn’t be that hard since on my Character i was able to use a branch and a Boolean to check if in this case “ShouldTrace” and it works like a charm in the character BP but when i try it using my weapon BPs no line ever shows.

---

<div class="post-metadata">

**Author:** ![Memo223](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Memo223](https://forums.unrealengine.com/u/Memo223)\
**Post date:** [November 7, 2019, 1:07pm UTC](https://forums.unrealengine.com/t/confused-regarding-line-traces-from-a-stored-location/132887/7 "2019-11-07T13:07:40Z")

</div>

Nevermind all that above, finally got it solved, Cheers for the advice and help!  
BR
