Skip to main content

Collider.ClosestPoint(Vector3 position)

Returns a point on the collider that is closest to a given location.

Parameters:

NameTypeDescription
positionVector3Location you want to find the closest point to.

Returns:

typeDescription
Vector3The point on the collider that is closest to the specified location.

Usage

---@type Collider
local collider;

---@type Vector3
local position;


local val0 = collider.ClosestPoint(position)