Download

Confused regarding Line Traces from a stored location

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

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.

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


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.

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.


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.

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.

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