Develop
Develop
Select your platform

Creating Ray-castable UIs

Updated: Nov 3, 2025

Set up your UI

  1. In the Hierarchy panel, add a Canvas by right-clicking and selecting UI > Canvas. The canvas appears in the Hierarchy.
  2. In the Hierarchy, select the Canvas. In the Inspector, under Rect Transform, set the following settings to position the Canvas where it can be easily interacted with and scales it to a manageable size:
    • Canvas > Render Mode: World Space
    • Rect Transform > PosX: 0
    • Rect Transform > PosY: 1.15
    • Rect Transform > PosZ: 1.5
    • Rect Transform > Width: 480
    • Rect Transform > Height: 720
    • Rect Transform > Scale: [0.0005, 0.0005, 0.0005]
  3. Add a panel to the Canvas by right-clicking on the Canvas in the Hierarchy and selecting UI > Panel. The panel appears in the Hierarchy.
  4. Add some UI elements to the panel to interact with. For example, right-click on the Panel in the Hierarchy and select UI > Button - TextMeshPro. The button element appears on the Panel. Add as many elements as you desire to create your UI.
    UI with elements

Add the Ray Interaction

  1. Right-click on the Canvas, and select Interaction SDK > Add Ray Interaction to Canvas. The Ray wizard appears.
    The quick actions menu.
  2. In the Ray Canvas wizard, you may see a message about a missing PointableCanvasModule. Select Fix. This will add the missing PointableCanvasModule.
    The fix all option
  3. If you want to further customize the interaction, adjust the interaction’s settings in the wizard. For details on the available options, please see the Ray Canvas Quick Action documentation.
  4. Select Create. The wizard automatically adds the required components for the interaction to the Canvas. It also adds components to the camera rig if those components weren’t already there.
    The automatically added GameObjects for a ray-castable UI.
Use Link to test your project.
  1. Open the Link desktop application on your computer.
  2. Put on your headset, and, when prompted, enable Link.
  3. On your development machine, in Unity Editor, select the Play button.
  4. In your headset, you can interact with the UI at a distance using ray-casting.

Test your Interaction with an APK

Build your project into an .apk to test your project.
  1. Make sure your headset is connected to your development machine.
  2. In Unity Editor, select File > Build Settings. Add your scene to the Scenes In Build list by dragging it from the Project panel or clicking Add Open Scenes.
  3. Click Build and Run to generate an .apk and run it on your headset. In the File Explorer that opens, select a location to save the .apk to and give it a name. The build process may take a few minutes.
  4. In your headset, you can interact with the UI at a distance using ray-casting.

Learn more

Design guidelines

  • Fonts and icons: Learn about fonts and icons components for immersive experiences.
  • Panels: Learn about panels components for immersive experiences.
  • Windows: Learn about windows components for immersive experiences.
  • Tooltips: Learn about tooltips components for immersive experiences.
  • Cards: Learn about cards components for immersive experiences.
  • Dialogs: Learn about dialogs components for immersive experiences.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon