I don’t understand why my character keeps starting at the beginning of the spline even though I’m grabbing and setting the point where the sphere trace hits the rail.
And this is cleaner/more precise? It does kinda seem that way but my other method was visually working the same. Would it have broken on splines with added points?
Asking cause I’m trying to learn how to fish more than just catch this one. Struggling a bit to completely wrap my head around exactly how splines are working in Unreal and while there are plenty of videos on the topics, they all seem to sort of “cheat” or use them much more stringently than what I’m trying to do.
In the “GetDistanceAlongSplineAtSplineInputKey()” method it is getting the distance from the key you are - so is working in a similar way to what you’ve done - I would use the Epic routines though (check out the source for that method).
Basically, the input key should have the index in the whole number, and the fraction should be amount between that index and the next. In practice I’ve seen input keys range between 0.0 and 1.0 though so I can’t explain those.