docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method TryGetCurrentARRaycastHit

    TryGetCurrentARRaycastHit(out ARRaycastHit)

    Declaration
    public bool TryGetCurrentARRaycastHit(out ARRaycastHit raycastHit)
    Parameters
    Type Name Description
    ARRaycastHit raycastHit
    Returns
    Type Description
    bool

    TryGetCurrentARRaycastHit(out ARRaycastHit, out int)

    Gets the first AR ray cast hit, if any ray cast hits are available.

    Declaration
    public bool TryGetCurrentARRaycastHit(out ARRaycastHit raycastHit, out int raycastEndpointIndex)
    Parameters
    Type Name Description
    ARRaycastHit raycastHit

    When this method returns, contains the ray cast hit if available; otherwise, the default value.

    int raycastEndpointIndex

    When this method returns, contains the index of the sample endpoint if a hit occurred. Otherwise, a value of 0 if no hit occurred.

    Returns
    Type Description
    bool

    Returns true if a hit occurred, implying the ray cast hit information is valid. Otherwise, returns false.

    Remarks

    If occludeARHitsWith2DObjects or occludeARHitsWith3DObjects are set to true and a 2D UI or 3D object are closer, the result will be false with the default values for both the raycastHit and raycastEndpointIndex.

    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)