docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetClosestPoint

    GetClosestPoint(Vector3)

    Tries to get the closest point on the associated snapping collider. If snapToCollider is null, it will return the transform position of the associated interactable. If both snapToCollider and interactable are null, it will return the transform position of this GameObject.

    Declaration
    public Vector3 GetClosestPoint(Vector3 point)
    Parameters
    Type Name Description
    Vector3 point

    The point for which we are trying to find the the nearest point on the snapToCollider.

    Returns
    Type Description
    Vector3

    The closest point on the snapToCollider if possible. Defaults to the interactable transform position if available, or the transform position of this GameObject.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)