Skip to content

format

typescript
Rigidbody.ClosestPointOnBounds(position)

class: Rigidbody

description

Returns the squared distance and coordinates of the point on the closest Rigidbody bounding box to the specified point.

This method can be used to get the closest point on a Rigidbody bounding box to a given point. It is particularly useful for performing collision detection or trigger detection operations. Typically, you would pass the point you want to check to this method and get the closest point on the Rigidbody bounding box.

parameter

param_nametypedescription
positionVector3The specified point.

reture

typedescription
ClosestPointThe squared distance and coordinates.

code example