How to get positions of all spline points

Hello,

I built a race track using spline and I want to have the positions of all the spline points so that I can calculate the curvature of the road.
I was wondering, is there a node in the blueprint that I can use to get that information and maybe output the positions into a file?

I saw this post: Get All Spline Points of a Spline Component?! (Blueprint Only) - Programming & Scripting - Epic Developer Community Forums
but the example in that post is not very clear to me. Can someone explain that example or suggest a new solution?

Thanks!

Yaxin,

You can use the node “Get Location at Spline Point” or “Get Location and Tangent at Spline Point”. You can request that the information is returned local to the spline, or world coordinates. If you want the data in an array, just use “Get Number of Spline Points” and drop into a For loop (remember to decrement the count returned by 1, as the count returned by the node is relative 1, and you will want relative 0, for the loop), and query the information you want, slap it into an array.

As far as writing the data out to a file, there are a couple of libraries around here, that have nodes for writing to a file.

or you could just use the “Print String” node, to place the data into the output log, and then copy and paste from there.
Hope this helps,

1 Like

Thank you ! I’ll try what you suggested.

Hi , I tried to implement your solution. My blueprint looks like this

However, I can’t get the positions to be printed on screen or in the log. Do you know why that might be?
Thank you for your help! I’m new to UE4 so apologize beforehand if I’m making some really obvious mistake :slight_smile:

I know this is an old post but, did you figure that out or you still need help?

hey there, you are just printing the index of th array here, not the position itself .
here is how to do this :

the bluprint to copy if you want :

1 Like