diff --git a/scene/resources/polygon_path_finder.cpp b/scene/resources/polygon_path_finder.cpp index afb0ae18156..9f691d6ad39 100644 --- a/scene/resources/polygon_path_finder.cpp +++ b/scene/resources/polygon_path_finder.cpp @@ -142,6 +142,7 @@ Vector PolygonPathFinder::find_path(const Vector2& p_from, const Vector if (dget(); closest_dist=d; + closest_point=closest; } } @@ -168,6 +169,7 @@ Vector PolygonPathFinder::find_path(const Vector2& p_from, const Vector if (dget(); closest_dist=d; + closest_point=closest; } } @@ -529,7 +531,7 @@ Vector2 PolygonPathFinder::get_closest_point(const Vector2& p_point) const { float d = p_point.distance_squared_to(points[i].pos); if (d