There is an error in the length of the straight spline?UE5.4

When my train system was running I noticed that the position of the front and rear bogies of the train would fluctuate significantly.
I tested three straight splines of the same length (1810m), checked the coordinates of all points to ensure that the splines are straight (double precision coordinates),A spline has 2 points,B has 4 points, and C has 14 points.
I generate a ball at 1500m of each spline.
A’s position is exactly right. B is to the right, and C is to the left. The error sometimes reaches ±70cm.
How to increase the accuracy of the spline.


2 Likes

What code are you using to place the ball?


If the points are of type Linear, then everything is quite predictable, but if you do it differently, then:

:thinking:

Providing the testing is not skewed by something we do not see here, this would point to the spline subdivision acting up.

Not that it should be necessary here (a straight), but do crank it up and see what you get:

3 Likes

Thanks for your answer, I tried to change the value of the Reparam steps segment. When the value became smaller, the position error became larger. Except for spline A, the sphere positions of spline B and C all changed greatly. As the value gets larger, the position of the sphere gets closer to where it should be.



1 Like

That’s truly worrying. And thank you for taking the time to run these tests!


And just to confirm, you’re getting Location at Distance, right:

As opposed to the Location at Time which would produce seemingly inconsistent results without the Use Contant Velocity ticked since it takes the spline point distribution into account.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.