x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Using a spline mesh to visualize trajectory?

Hi,

So I followed this nice tutorial ( https://wiki.unrealengine.com/Simple_Line_Trace_Ricochet ) 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 :)

alt text

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

alt text

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

Product Version: UE 4.10
Tags:
image 011.png (206.9 kB)
image 010.png (281.1 kB)
more ▼

asked Mar 09 '16 at 10:39 AM in Blueprint Scripting

avatar image

sarchasm
81 15 19 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

alt text

untitled-1.png (349.9 kB)
more ▼

answered Mar 10 '16 at 09:10 AM

avatar image

sarchasm
81 15 19 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question