Version: 2017.4
public static Vector3 ClosestPoint (Vector3 point, Collider collider, Vector3 position, Quaternion rotation);

パラメーター

pointLocation you want to find the closest point to.
colliderThe collider that you find the closest point on.
positionThe position of the collider.
rotationThe rotation of the collider.

戻り値

Vector3 The point on the collider that is closest to the specified ___location.

説明

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

Note that in case the specified ___location is inside the collider, or exactly on the boundary of it, the input ___location is returned instead.

The collider can only be BoxCollider, SphereCollider, CapsuleCollider or a convex MeshCollider.

See Also: ClosestPoint.