+1 vote

To move a point in curve2d in game use:
path.curve.set_point_position (2, get_local_mouse_position ())
With this function I move the point at index 2 of the curve with the mouse, but what I want to do, instead of moving point 2, is to move the point closest to the mouse.
This is the function:
get_closest_point (to_point: Vector2)
But this function returns a vector2 with the coordinates of the point. What I want is to return your index number in the array. What am I missing here, any ideas?

asked Jun 2 in Engine by estebanmolca (1,203 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.