Hey all,
Im attempting to use Unity’s Spline package (v2.4.0) but when using the SplineUtility.GetNearestPoint function, its consistently returning incorrect results. I have a fairly simple spline with 4 knots, and are simply taking a test sphere and debugging the closest point on the spline. It works for some portions of the spline, but seems to skip over certain sections of the spline entirely, and other times returns points that arent on the spline at all. Whats strange is that between tests, it seems to always skip over the same section. That section is between the first two knots of the spline, and the closest point is correct for most of that space between the two knots, but consistently gets stuck at a certain point.
Heres an image showing it working correctly on the first section:
And heres where it gets stuck:
Here it is returning a point that isnt on the spline at all:
Ive tried using higher resolutions / iterations in the function but it doesnt change anything.
Anyone know whats going on here??