AStar2DGetClosestPositionInSegment Method |
Returns the closest position to to_position that resides inside a segment between two connected points.
var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 5)) astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3)
The result is in the segment that goes from y = 0 to y = 5. It's the closest position in the segment to the given point.
Namespace: Godot
public Vector2 GetClosestPositionInSegment( Vector2 toPosition )
[Missing <param name="toPosition"/> documentation for "M:Godot.AStar2D.GetClosestPositionInSegment(Godot.Vector2)"]
[Missing <returns> documentation for "M:Godot.AStar2D.GetClosestPositionInSegment(Godot.Vector2)"]