Whether there is a way to set roll at spline point through blueprint or c++

Hello, dear comunity. Is it possible to set roll to the spline points to get roll at spline points along the spline? I do that before in editor mode (see screenshot) and I used [Get spline roll at distance method][1] and everything works:

For now road generating at begin play. I’m setting roll to the road with [Set Start Roll][3] and [Set End Roll][4]. Road rolling just like in screenshot presented before, but “Get spline roll at distance along spline” doesn’t work, because I just rotating mesh. So my answer is: Is it possible to roll spline points through BP or c++? If it’s not how to do method working like “Get spline roll at distance along spline” method to get rolls at all points along spline, not just control points?
Sorry for my bad english.

I need to know this too. Making a train simulator and trying to create superelevation without this feature is proving to be troublesome.

Also, why would there be a Get Roll at Spline Point and not a corresponding Set command?

You can get roll with a call like: Spline->GetRollAtDistanceAlongSpline(Position,ESplineCoordinateSpace::World);

(Output in degrees) And then set the roll to your splinemeshcomponent (Which takes roll in radians… o_O)

There is no way that I have found to set the roll to the spline. I saw some comment from Epic that “It’s a work in progress”, no Idea when it may materialize though. I saw nothing mentioned in 4.14 release notes.

Hi again.

So, I had this problem as well and thought - hey, the Editor has a gizmo for it, let’s see how they do it.
So I found the solution in SplineComponentVisualizer.cpp, here is my stripped down version of HandleInputDelta that just deals with Roll.

 void RollSplinePoint(USplineComponent* SplineComp, int32 SelectedKeyIndex, float Deg) {
	if (SelectedKeyIndex < 0 
		|| SelectedKeyIndex > SplineComp->GetNumberOfSplinePoints()) return;

	FInterpCurveQuat& SplineRotation = SplineComp->GetSplinePointsRotation();
	FInterpCurvePoint<FQuat>& EditedRotPoint = SplineRotation.Points[SelectedKeyIndex];

	EditedRotPoint.OutVal = FRotator(0.0, 0.0, Deg).Quaternion();
		
	SplineComp->UpdateSpline();
	SplineComp->bSplineHasBeenEdited = true;
}

A word of caution though, I was doing the same thing as you - banking roads.

I created the spline by just running:

RoadSegmentSpline->SetSplinePoints(points, ESplineCoordinateSpace::World);

And if the second splinepoint is at +X, +roll is clockwise.
If the second splinepoint is at -X, +roll is counter clockwise.

My solution was to check the first two points of the road and rotate the RootComponent before setting the splinepoints.