How do I calculate the direction of travel between two vertices of a spline?

Control a vehicle mesh to move.

F20B3B2A-B161-427f-BDEC-F28EF361501A

This kind of thing?

1 Like

GetTransformAtDistanceAlongSpline to obtain a value of 0 when the Spline is added in the blueprint of vertices.

What do I do to get the driving direction attitude in the spline?

The spline is in local coordinates. If the first point on the spline is at the origin, then you will indeed get 0,0,0 back.

To rotate a local coordinate / vector / orientation into whatever world space the Spline uses, get the actor that contains the Spline, and apply its transform to the point/vector/orientation.

For direction of the spline, look for its Tangent at a particular point.
You’ll probably want `“Find Direction Closest to World Location”:

(This also does world space transform for you)

1 Like