Hi, your capsule component is world aligned by default so it will always be facing the same direction.
You will need to use the actor rotation. So… GetActorRotation…
Hope that helps! =)
P.S.(But just use the Actor rotation) There are three options for the pitch yaw and roll of the capsule. Only Yaw is set to True by default because it’s oriented around Z is up logic and there isn’t a need to rotate the capsule along the other two axis’s unless your game doesn’t stay in Z is up logic. Setting the other two to True will allow the rotation of the capsule in the editor.
The easiest way to do this is to add an arrow component to your scene. This gives us a reference point from which to grab rotation information. The arrow should be pointing “forward” relative to your mesh. (usually down X)
As with a normal line trace, start by getting the World Location of the Arrow Component and plug this into the Start of your line trace. Then you get the forward vector of the Arrow Component and multiply this by your trace length (distance you want the line to extend). You then drag a line off your Arrow Component and type “rot” and add a “Add World Rotation” node. In my example I’m rotating 90 degrees on the Y axis so that the line fires to the right instead of forward. You then connect the Add World Rotation node to your line trace and of course call the AddWorldRotation node from whatever you’re using to call your line trace. E key for example. In my screenshot its not connected to anything but it needs to be in order to work.
That’s it. Really simple way to change the rotation of your line trace. You can even call multiple line traces at once using a sequence to create a radial trace. Not exactly sure how system intensive it is to call multiple line traces at once, but it should be fine.