No way to set roll of spline in blueprint

The fancy new splines are beautiful, but there’s currently no way to adjust the roll/banking of a splinepoint in blueprints (and neither in code I think).

The SetTangentAtSplinePoint takes a vector so no roll information is given there. And the SetDefaultUpVector changes the roll of the entire spline, not pieces of it.

Being able to set the roll of individual spline points would be really handy for rollercoasters etc.

Hi Requios,

There is not currently a way to set the roll of a spline point, however we have a feature request in our system to improve upon spline manipulation over time.

Right now, you can set the rotation of the Spline Mesh Component that makes up the track. You can do this within blueprints and code. Basically you will need to get the tangent and distance of the spline and using math, calculate the correct rotation of the Spline Mesh Component.

Cheers,

TJ

Thanks for the reply.
I’m already using Spline Mesh Components and setting their roll with success, I’m just saying it would be cleaner to get and set that roll on the spline instead of a separate array. It works, but could be cleaner/easier :slight_smile:

I’m sorry for digging up an old thread, but this is exactly what I am trying to do and I have had no luck in finding any tutorial or anything that covers it. I have been trying to calculate the roll (start and end) of a spline mesh using the tangent of the spline, but i end up with a mess, could you please tell me how you did it?

What I did for my rollercoaster is to not store the roll in the spline, but in a separate array. So for each spline point I also have data in an array, including roll. Then I call SetStartRoll and SetEndRoll on the spline mesh component with that separate data.

If you somehow managed to store roll in the spline itself then retrieving that is trivial: spline has GetRoll functions built-in.

I looked at it some more and found that in the newer versions of the engine you can actually set the up vector of a spline at each point (SetUpVectorAtSplinePoint). A quick glance through the code reveals that this sets the rotation of a spline point. So you can rotate that up vector with how much roll you want, and that way you can store the roll in the spline itself.

Hi All, this is an old thread but I just needed to do the same thing, accomplished in the image below. Used a normalize to range node to translate the rotation to avoid the spiral effect when rolling the spline point.