Curve2D.get_closest_point() doesn't work as documented?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jgodfrey

According to the docs, Curve2D.get_closest_point(to_point):

Returns the closest baked point (in curve’s local space) to to_point.

However, in practice, that doesn’t seem to be the case. The point returned by the call seems to be an interpolated point along the Curve2D based on the to_point argument. That is, it returns a Vector2 that’s (potentially) not found in the collection of baked points.

I took a quick look at the source code for get_closest_point() and, indeed, it does not appear to explicitly return one of the baked points (though I didn’t follow some of the details there).

So, is this a documentation error, a bug in the way the function works, or just a misunderstanding on my part?

:bust_in_silhouette: Reply From: jgodfrey

This appears to be a documentation error. I’ve submitted a bug report here: