docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Ray casts platform support

    Understand the AR Foundation capabilities implemented by the OpenXR Spatial Entities ray cast provider.

    This package implements the following optional features of AR Foundation's XRRaycastSubsystem:

    Feature Descriptor Property Supported
    World based ray cast supportsWorldBasedRaycast Yes
    Viewport based ray cast supportsViewportBasedRaycast
    Tracked ray casts supportsTrackedRaycasts
    Trackable types supportedTrackableTypes Determined at runtime

    Supported runtimes

    This provider requires three OpenXR extensions: XR_ANDROID_spatial_discovery_raycast, XR_EXT_spatial_entity, and XR_EXT_future. If a runtime doesn't enable all three, the provider fails to initialize and reports no trackable types.

    Refer to the following table to understand the expected behavior of the Spatial Entities Ray Casts feature on supported runtimes:

    Runtime Supported Trackable types
    Android XR Yes PlaneWithinPolygon, Depth
    Meta Horizon OS None

    As of this package's release date, Meta Horizon OS doesn't implement XR_ANDROID_spatial_discovery_raycast. To cast rays against Meta Horizon OS depth data, use the ray cast feature in the Unity OpenXR: Meta package instead.

    Supported trackable types

    The trackable types this provider reports depend on your project configuration, not only on the OpenXR runtime. supportedTrackableTypes is empty until a session starts, so check it only after that. If you enable the Spatial Entities Ray Casts feature and change nothing else, it remains empty.

    Trackable type Requires
    PlaneWithinPolygon The Spatial Entities Planes feature and a runtime that reports ray cast results for plane tracking.
    Depth Depth ray casts, which are disabled by default.
    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)