Files
adriadri6972 d3d9c5f833 upload project
2025-07-31 15:21:08 +02:00

2.6 KiB

uid
uid
arfoundation-raycasts-raycastmanager

AR Raycast Manager component

The ARRaycastManager is a type of trackable manager that performs ray casts in your app.

AR Raycast Manager component
AR Raycast Manager component

Property Description
trackablesChanged Invoked when trackables have changed (been added, updated, or removed).
Raycast Prefab If not null, this prefab is instantiated for each ray cast.

Get started

Add an AR Raycast Manager component to your XR Origin GameObject to enable ray casting in your app. If you don't have an XR Origin GameObject in your scene, first follow the Scene setup instructions.

Whenever your app doesn't need ray casting functionality, disable the AR Raycast Manager component to disable ray casting, which can improve app performance. If the user's device does not support ray casting, the AR Raycast Manager component disables itself during OnEnable.

Types of ray cast method

There are two types of ray casts you can perform in your mixed reality project, if supported by your chosen platform. Refer to the following pages to understand and use each type of ray casting method:

Type Description
Single ray casts Ray casts that occur once.
Tracked ray casts Ray casts that continue to update for the entire AR session, or until cancelled.

Sample scene with ray casts

The Simple AR scene in the AR Foundation Samples GitHub repository provides an example scene using ray casting functionality against planes. You can use the configurations in this sample scene to get started with ray casting in your project.