Creating a Dash Function Using Line Trace by Channel

Hello! I am trying to create a dashing function using a line trace with a 2/D character in a 3/D world. Is there a correct way in order to get the direction in front of the actor? The character itself points in a diagonal direction so the line trace does not work since there are actors in that direction. So in a 3D game that would be a wall etc… Is there a way of getting the area in-front of the actor without having to type the end vector manually? The forward vector of the actor points in a diagonal. It is really tedious due to the fact that the line trace needs to be specific.
downward direction according to the line trace debugger is their a way to fix this?

This would trace 500uu along the forward direction:

The line trace by channel is just for debugging purposes so if I just use this same calculation on the set actor location I would return the correct movement transform?

The line trace by channel is not for debugging, I think you mean the draw debug type, which is used to visually draw a line that is traced.

I believe Everynone got it. The forward vector is the proper direction to point in the direction of the +x of the actor.

Pardon me for my ignorance. Thank you both for the help!

Here is the final result of what I have done.
This line trace gets the distance of the line trace of the forward vector of the actor. Then sets the actor location to the distance of the line trace itself (not whether the line trace successfully collides with an object) then sets the actor location. Thank you for the help!

If you do not care about the obstacles, you do not need a line trace at all. The Trace End on Break Hit Result is the same as the End on the trace node.

So you can scale the direction vector as you do and place the actor there. And in case something collides you can still use Sweep on the Set Actor Location node to intercept potential collision there.

It will work as is atm, sure but the trace seems redundant in this very case.

If you’re just looking at moving the actor forward by a set amount, take the end vector (get actor forward vector multiplied by distance and added to the get actor location), and set the actor location to that. Skip all the LineTraceByChannel and break hit results. Make sure to set the Z-coordinate appropriately (otherwise the actor will move up and down, possibly through the floor or hovering in air). You can keep the same z coordinate if you want to, broken out from GetActorLocation, as the z coordinate in SetActorLocation.

I know I can just use set actor location it is just that a person wants me to create a dash using a line trace rather than just using set actor location. I know the redundancies and you don’t have to check for collision using a dash I could use just set actor location and check the sweep box so that you don’t just move through a pawn or actor. It is just in this case. I HAVE to use a line trace not that I want to use a line trace. I completely understand the concern. You don’t use a line trace for a dash function you either move to the target location and make a mistake or don’t.
It is like checking to see if the line trace collides with another actor or pawn then if it does you can dash. You should be able to dash regardless of whether or not there is another actor character or pawn in front of the character. Checking the area in front of the actor is redundant I completely agree.