Controller Pointer Prefab

A common approach for interacting with UI and 3D objects in an XR scene is to use a laser pointer that is activated by the trigger button. Telerik XR Interactions provides this functionality through its Controller Pointer prefab.

Setting Up the Prefab within the XR Rig Hierarchy

To set up this prefab in your scene:

  1. Drag and drop the Controller Pointer prefab as a direct child to the XR Rig root node.

  2. Edit the ControllerPointer component on the root level by choosing the controller hand (for instance, select Left for a left hand controller).

  3. To specify which layers can interact with this pointer, set the Event Mask from the Raycast section.

  4. Make sure that your scene has a single instance of Unity's Event System as this is needed for performing the raycasting calculations.

Using the Prefab as Child of PointersController

If you have several pointers within your application, you will need some logic that manages the priority of each pointer so that their actions are not executed simultaneously. For this purpose, the Telerik XR Core package provides the PointersController class that you can attach to a child object in the XR Rig hierarchy.

For an example on how to integrate the Controller Pointer prefab with the PointersController logic, see the XR Interactions Rig prefab and its Pointers child node. Additionally, if you have purchased the Telerik XR Interaction package, you may see a fully initialized PointersController component instance in theXR Rig Complete prefab and its Pointers prefab child node.

In this article
Not finding the help you need?