Closest Point
Projects a Vector3 onto the nearest point of a Path. Returns the closest point, its parameter along the curve, and the distance.
Node
Interactive preview is available in the interactive reader.
Sockets
path (in)- Path. Required — the curve to project onto.
query (in)- Vector3. Required — the point to project.
point (out)- Vector3 — the closest point on the path.
t (out)- Float — normalised arc-length parameter ∈ [0, 1] of the closest point.
distance (out)- Float — distance from query to the closest point.
Parameters
This node has no parameters.
How It Works
Walks every segment of the path and computes the perpendicular projection of query onto that segment, clamped to the segment's endpoints. Keeps the minimum distance and returns the associated point / parameter.
t is arc-length normalised: t=0 at the path start, t=1 at the end. For closed paths the wrap is included in the length computation.