Version: 2022.2
LanguageEnglish
  • C#

ClosestPointCommand Constructor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public ClosestPointCommand(Vector3 point, int colliderInstanceID, Vector3 position, Quaternion rotation, Vector3 scale);

Parameters

point Location you want to find the closest point to.
colliderInstanceID The ID of the Collider that you find the closest point on.
position The position of the Collider.
rotation The rotation of the Collider.
scale The global scale of the Collider.

Description

Create a ClosestPointCommand using Instance ID of the Collider.


Declaration

public ClosestPointCommand(Vector3 point, Collider collider, Vector3 position, Quaternion rotation, Vector3 scale);

Parameters

point Location you want to find the closest point to.
collider The Collider that you find the closest point on.
position The position of the Collider.
rotation The rotation of the Collider.
scale The global scale of the Collider.

Description

Schedule a batch of closest points which are performed in a job.

Can only be invoked from the main thread, since Unity Components are unavailable off the main thread. In the threaded context, use the other constructor that accepts Instance ID instead.