Click or drag to resize

AStar2DGetClosestPoint Method

Returns the ID of the closest point to to_position, optionally taking disabled points into account. Returns -1 if there are no points in the points pool.

Note: If several points are the closest to to_position, the one with the smallest ID will be returned, ensuring a deterministic result.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public int GetClosestPoint(
	Vector2 toPosition,
	bool includeDisabled = false
)

Parameters

toPosition
Type: GodotVector2

[Missing <param name="toPosition"/> documentation for "M:Godot.AStar2D.GetClosestPoint(Godot.Vector2,System.Boolean)"]

includeDisabled (Optional)
Type: SystemBoolean

[Missing <param name="includeDisabled"/> documentation for "M:Godot.AStar2D.GetClosestPoint(Godot.Vector2,System.Boolean)"]

Return Value

Type: Int32

[Missing <returns> documentation for "M:Godot.AStar2D.GetClosestPoint(Godot.Vector2,System.Boolean)"]

See Also