docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryAddRaycast

    TryAddRaycast(Vector2, float, out XRRaycast)

    Adds a new persistent raycast. Persistent raycasts should be updated automatically until this provider is stopped or destroyed or the raycast is removed with RemoveRaycast(TrackableId).

    Declaration
    public virtual bool TryAddRaycast(Vector2 screenPoint, float estimatedDistance, out XRRaycast raycast)
    Parameters
    Type Name Description
    Vector2 screenPoint

    A position on the screen in normalized screen coordinates (0, 0)..(1, 1).

    float estimatedDistance

    The estimated distance to the raycast target.

    XRRaycast raycast

    The newly added raycast. All spatial data should be reported relative to the XR origin.

    Returns
    Type Description
    bool

    True if the raycast was added; otherwise false.

    TryAddRaycast(Ray, float, out XRRaycast)

    Adds a new persistent raycast. Persistent raycasts should be updated automatically until this provider is stopped or destroyed or the raycast is removed with RemoveRaycast(TrackableId).

    Declaration
    public virtual bool TryAddRaycast(Ray ray, float estimatedDistance, out XRRaycast raycast)
    Parameters
    Type Name Description
    Ray ray

    A ray in session space defining the raycast.

    float estimatedDistance

    The estimated distance to the raycast target.

    XRRaycast raycast

    The newly added raycast. All spatial data should be reported relative to the XR origin.

    Returns
    Type Description
    bool

    True if the raycast was added; otherwise false.

    In This Article
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Friday, September 22, 2023