Skip to content

Api > CapsuleCollider > ClosestPoint()


CapsuleCollider.ClosestPoint(Vector3 position)⚓︎

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

Parameters:⚓︎

Name Type Description
position Vector3 Location you want to find the closest point to.

Returns:⚓︎

type Description
Vector3 The point on the collider that is closest to the specified location.

Usage⚓︎

---@type CapsuleCollider
local capsulecollider;

---@type Vector3
local position;


local val0 = capsulecollider.ClosestPoint(position)