docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface ICurveInteractionCaster

    Interface containing necessary information to perform various types of casts along a curve. The caster is responsible for updating the sample points, performing the cast and returning a sorted list of colliders.

    Inherited Members
    IInteractionCaster.isInitialized
    IInteractionCaster.castOrigin
    IInteractionCaster.effectiveCastOrigin
    IInteractionCaster.TryGetColliderTargets(XRInteractionManager, List<Collider>)
    Namespace: UnityEngine.XR.Interaction.Toolkit.Interactors.Casters
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    public interface ICurveInteractionCaster : IInteractionCaster

    Properties

    lastSamplePoint

    Gets the sample point at the last index of samplePoints.

    Declaration
    Vector3 lastSamplePoint { get; }
    Property Value
    Type Description
    Vector3
    See Also
    CurveInteractionCaster

    raycastMask

    Gets or sets the layer mask used for limiting ray cast targets.

    Declaration
    LayerMask raycastMask { get; set; }
    Property Value
    Type Description
    LayerMask
    Remarks

    Implemented as a default interface member to avoid a breaking change since this property was introduced after the interface was public. Implementers of this interface should typically implement this property as:

    [SerializeField]
    LayerMask m_RaycastMask = -1;
    

    public LayerMask raycastMask { get => m_RaycastMask; set => m_RaycastMask = value; }

    See Also
    CurveInteractionCaster

    samplePoints

    Gets the curve sample points used to determine interaction results.

    Declaration
    NativeArray<Vector3> samplePoints { get; }
    Property Value
    Type Description
    NativeArray<Vector3>
    See Also
    CurveInteractionCaster

    Methods

    TryGetColliderTargets(XRInteractionManager, List<Collider>, List<RaycastHit>)

    Tries to get a list of collider targets based on the interaction caster's current state, sorted by their distance from the cast origin.

    Declaration
    bool TryGetColliderTargets(XRInteractionManager interactionManager, List<Collider> colliders, List<RaycastHit> raycastHits)
    Parameters
    Type Name Description
    XRInteractionManager interactionManager

    The XR interaction manager.

    List<Collider> colliders

    List of colliders to populate with detected targets.

    List<RaycastHit> raycastHits

    List of raycast hits lined up to the list of colliders.

    Returns
    Type Description
    bool

    True if targets are successfully detected.

    See Also
    CurveInteractionCaster

    See Also

    CurveInteractionCaster
    In This Article
    Back to top
    Copyright © 2026 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)