Evenly Distribute Spline Meshes Along Spline

Thanks a lot for this workaround.
In my case, I had a macro that stretched a splinemesh between two lengths along the spline (taking in a start and end length parameter), and so I simply normalised and then multiplied by the end length minus the start length. It works great.

I had previously raised a bug about the how the Get Tangent At Distance Along Spline feature is bugged here: Unreal Engine Issues and Bug Tracker (UE-61908) - hopefully that will get fixed soon, and we won’t need to rely on this workaround any more.

This system works so well! A few things that I need to adjust for my use. I’ve got a series of bottles on my spline and I want to space them a bit from each other rather than just having them one after the other touching one another. Is there a way to add some spacing between each mesh?

Also, is there any way that you can make these animate?

Thanks!!

You are already working with distances along the spline, so you can easily perform any extra maths you need before using it.

@Gavin.Kistner, this is a really good explanation of the method used for distributing mesh along a spline.
Saved me a lot of time and headache.

cheers

Thanks! I think I got it to work now. For C++ users it goes something like:

FVector startTan =
spline->GetTangentAtDistanceAlongSpline(startDist,ESplineCoordinateSpace::Local);
FVector endTan =
spline->GetTangentAtDistanceAlongSpline(endDist,ESplineCoordinateSpace::Local);

if (startTan.Size() >= pieceLength) {
startTan.Normalize(); startTan *=
pieceLength; }

if (endTan.Size() >= pieceLength) {
endTan.Normalize(); endTan
*=pieceLength; }

1 Like

Just want to say, still to this day, this post has come extremely in handy. Wouldnt have solved this issue myself. Thanks for the help!

Well, Epic ignored the bug for three years, and have now just randomly marked it as Won’t Fix without a word.

Why do I even bother raising bugs? They don’t care.

5 Likes

Works perfectly. Thanks.