Get Tangent At Distance Along Spline Affected by Length

I’m using a Spline Component to create a road network.

In order to keep the road pieces from stretching/squashing, I’ve used “GetTangentAtDistanceAlongSpline” to get the start/end tangents of each piece.

However when I move the points of the spline too far apart, the tangents become distorted.
The distortion happens when the distance between two spline points is greater than the length of one length of road.

253809-splinepoints.png

When the distance between two points is less than one length, the tangent seems to have less of an effect on any spline mesh created with it.

253810-lessthanonelength.png

Found a workaround.

It seems the length of the tangent is increased as the distance between points increases.
(I’m not sure if this is intended behaviour)

Basically I just normalized the tangent vector and multiply it by the length of one road unit.

253813-fix.png

4 Likes

Thank you!! You just saved me hours of guess work and debugging! :heart:

thanks man, that helped me too!

Ditto for me in 2021!!

You have saved me a lot of head ache! thanks!

Years later and this is still helpful, thanks!