{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method CastRay | Unity Physics | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CastRay

    CastRay(RaycastInput)

    Cast a ray against the object.

    Declaration
    bool CastRay(RaycastInput input)
    Parameters
    Type Name Description
    RaycastInput input

    The input.

    Returns
    Type Description
    bool

    True if it hits, otherwise false.

    CastRay(RaycastInput, out RaycastHit)

    Cast a ray against the object.

    Declaration
    bool CastRay(RaycastInput input, out RaycastHit closestHit)
    Parameters
    Type Name Description
    RaycastInput input

    The input.

    RaycastHit closestHit

    [out] The closest hit.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    CastRay(RaycastInput, ref NativeList<RaycastHit>)

    Cast a ray against the object. Return true if it hits, with details of every hit in "allHits".

    Declaration
    bool CastRay(RaycastInput input, ref NativeList<RaycastHit> allHits)
    Parameters
    Type Name Description
    RaycastInput input

    The input.

    NativeList<RaycastHit> allHits

    [in,out] all hits.

    Returns
    Type Description
    bool

    Return true if it hits, with details of the closest hit in "closestHit".

    CastRay<T>(RaycastInput, ref T)

    Generic ray cast. Return true if it hits, with details stored in the collector implementation.

    Declaration
    bool CastRay<T>(RaycastInput input, ref T collector) where T : struct, ICollector<RaycastHit>
    Parameters
    Type Name Description
    RaycastInput input

    The input.

    T collector

    [in,out] The collector.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    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)