Using a spline mesh to visualize trajectory?

Hi,

So I followed this nice tutorial ( A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums ) and got it all working. But I want to replace it with something other than the debug lines. I played around with beams but wasn’t totally happy with the result (doesnt look like the rest of my hud elements exactly). So instead, I wanted to use a Spline Mesh component. I added it to my character actor, made it movable and attached it to my “arrow” mesh (stand in reticle). I then plugged in the vectors from the tutorial and it looks pretty good!

Except for when I rotate it. Depending on how I do it I get two different results. My first method was adding a spline mesh component to the actual blueprint and then updating the starting and ending positions. This method causes the mesh to turn faster than the actual trace (or at least the end position). My other method, was I instead added a spline mesh component in blueprint and set it to ‘manual attachment’ and updated the begin/end positions there.

I’m guessing that perhaps I should be altering the tangent somehow but I’m not sure where to begin. Anyways, any help would be greatly appreciated! And if this is a fools errand that would be helpful too. Basically, I want a line drawn indicating the forward vector for my ball and once it hits an object (within range) it would adjust (rather that drawing through the colliding object). If there is a better way I’m all ears :slight_smile:

81502-image+011.png

First method, you can see the spline mesh isn’t aligned with the line trace.

Second method, you can see the spline mesh won’t draw past -90 or 90 degrees of north. (disregard the many drawn spline meshes)

After digging around more and thinking about it I figured it out! Posting my solution for anyone that has any similar problems. Basically, I just spawn a spline and a spline mesh component at begin play. I then do my trace and save the begin and end position for the spline’s two points. If the trace hit something, I save that hit location for the end position, if not I save the default length of the trace for the end position. Rest is pretty obvious in the blueprint.