docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetClosestPointOfAttachTransform

    GetClosestPointOfAttachTransform(IXRInteractor)

    Tries to get the closest point on the associated snapping collider based on the attach transform position of the associated interactable. If snapToCollider is null, it will return the attach transform position of the associated interactable. If interactable is also null in that case, it will return the transform position of this GameObject.

    Declaration
    public Vector3 GetClosestPointOfAttachTransform(IXRInteractor interactor)
    Parameters
    Type Name Description
    IXRInteractor interactor

    The IXRInteractor interacting with the XRInteractableSnapVolume used to get the attach transform.

    Returns
    Type Description
    Vector3

    The closest point on the snapToCollider if possible. Defaults to the interactable attach transform position of the associated interactor 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)