Ray casting specs
Updated: May 6, 2026
This guide provides detailed specs behind ray casting interactions. These technical parameters control how the laser beam appears, how the cursor behaves at distance, when the ray auto-hides, and how the system picks the right target. Understanding these values helps you tune and replicate familiar ray behaviors in your app.
The system uses two different lengths for ray casting. The hit-test ray is an invisible line that extends far from the user’s hand or controller to detect interactable surfaces. The visible laser beam is much shorter, extending only partway from the hand to the hit point. This separation lets the system detect targets at range without drawing a long beam across the entire scene.
| Parameter | Value | Description |
|---|
Hit-test ray length | 10.0 m | The invisible ray that detects interactable surfaces. Targets beyond this distance are not detected. |
Visual beam length (hands) | 0.25 m | The visible laser extends 25 cm from the hand toward the target |
Visual beam length (controllers) | 0.35 m | The visible laser extends 35 cm from the controller toward the target |
The visual beam extends from the hand or controller to the hit point, or to the maximum visual length, whichever is shorter. If the ray hits a surface 15 cm away, the beam stops there.
Designing for the length difference
Because the hit-test ray extends much farther than the visible beam, the user can target objects without seeing a laser connecting them. The cursor on the target surface is the primary visual indicator for distant interactions, not the beam itself. The laser beam provides visual feedback about the current interaction state. It changes color when the user selects a target and has different widths depending on the display context.
| Parameter | Value | Description |
|---|
Beam color (hovering) | White (#FFFFFF) | Default beam color when pointing at an interactable surface |
Beam color (selecting) | Dark blue (#001E78) | Beam color when the user is pinching or holding the trigger |
Beam width (Home) | 0.0005 m | The beam is 0.5 mm wide in the Home environment |
Beam width (Overlay) | 0.001 m | The beam is 1 mm wide in Overlay mode, slightly thicker for visibility |
Beam Z offset | 0.1 m | A 10 cm gap between the hand and the start of the beam prevents visual clipping |
When the user’s hand approaches a surface, the laser fades to transition smoothly to direct touch. For hands, the beam fades out over the last 5 cm before the surface. Controllers do not fade near surfaces.
| Parameter | Value |
|---|
Hand panel Z fade | 0.05 m |
Controller panel Z fade | 0.0 m |
The cursor appears at the point where the ray intersects an interactable surface. It uses depth-compensated scaling so it maintains a consistent apparent size regardless of distance. The cursor also changes size and color to indicate interaction state.
| Parameter | Value | Description |
|---|
Apparent size | Constant angular size | The cursor uses depth-compensated scaling, so it appears the same size to the user regardless of how far the targeted surface is. |
State-based scaling | Hovering ring is the baseline; selecting ring shrinks to roughly 83% of the hovering size | The ring contracts when the user pinches or pulls the trigger, providing a clear visual signal of engagement. |
Color (hovering) | White (#FFFFFF) | Matches the laser beam color in the hovering state |
Color (selecting) | Dark blue (#001E78) | Matches the laser beam color in the selecting state |
For hand input, the cursor radius interpolates linearly with pinch strength. As the user brings their index finger and thumb closer together, the cursor smoothly transitions from the hovering radius to the selecting radius.
The cursor uses different transition durations for different state changes. Faster transitions for press and release give the interaction a responsive feel, while slower transitions for hover and removal avoid jarring visual changes.
| Transition | Duration |
|---|
Hover highlight (color change) | 0.3 s |
Press (pinch or trigger) | 0.08 s |
Release (pinch or trigger) | 0.1 s |
Cursor removal fade | 0.5 s |
Poke activation fade | 0.1 s |
When the user’s ray passes near multiple interactable surfaces, the system needs to pick the right one. It uses a distance threshold and a priority score to avoid flickering between adjacent targets.
| Parameter | Value | Description |
|---|
Equal distance threshold | 0.01 m | When two surfaces are within 1 cm of each other along the ray, the system treats them as equally close |
Tiebreaker score | 0 (default) | When surfaces are equally close, the higher tiebreaker score wins. Set per interactable. |
The system always selects the closest hit along the ray. The equal distance threshold and tiebreaker score only apply when two surfaces are nearly the same distance away. This prevents the cursor from flickering between overlapping elements.
Using tiebreaker scores
Assign higher tiebreaker scores to interactive elements that should take priority when they overlap with other surfaces. For example, a button rendered on top of a scrollable panel should have a higher score than the panel itself. Ray auto-hide and disable
The ray is disabled (and the laser fades from view) in situations where it would conflict with another interaction or has nothing to act on. While the ray is disabled the user cannot select with it, even if the laser is mid-fade. The ray reactivates automatically when the conflict clears or a valid target is back in range.
- Poke active on the same hand. The poke takes over interaction. The fade uses an asymmetric curve that starts at 60% of the poke timeline and completes before contact.
- Direct grab active. The direct grab owns the interaction. The laser hides so it does not obscure the grabbed object.
- Pointing away from surfaces. When the ray is not aimed at any interactable, the beam fades to avoid drawing a floating laser into empty space. The fade begins at 50 cm from the nearest surface.
- Teleporting. Teleport locomotion takes over input.
- Device disconnected. The laser fades out over 0.25 seconds rather than disappearing instantly.
Head ray visibility
The head ray (fallback mode) shows only a cursor on the target surface. The laser beam is not drawn for head ray interactions. | Parameter | Value |
|---|
Default fade duration | 0.25 s |
Disconnect fade | 0.25 s |
Length fade threshold | 0.1 m (beam fades below 10 cm length) |
When the headset has no external input available (no hands detected, no controller connected), the system falls back to the head ray. The head ray uses the center of the user’s field of view for targeting and the headset buttons for selection. There is a delay before the head ray activates to avoid false activation during brief hand tracking interruptions.
| Parameter | Value | Description |
|---|
Activation delay | 20.0 s | The system waits 20 seconds after losing all external input before activating the head ray |
Recently active window | 30.0 s | Once the head ray has been used, it stays available for 30 seconds after the last interaction |
Suppression timeout | 0.5 s | Brief suppression window during input mode transitions to prevent accidental activation |
Designing for head ray
If your app supports headset-only input, plan for the 20-second activation delay. Consider providing visual feedback that tells the user the head ray is about to become available. The delay prevents false activations but may confuse users who expect immediate input. The system provides haptic and audio feedback at key moments during ray interactions. These affordances are automatic and help the user confirm that their targeting and selection registered.
| State | Affordances |
|---|
Hover | Haptic: System hover effect. No audio. |
Select | Haptic: System press effect. Audio: 3D-positioned click sound at the hit point. |
Release | No dedicated haptic or audio feedback. |
Meta XR Interaction SDK (Unity) | |
Meta XR Interaction SDK (Unreal) | |
Meta Spatial SDK | |
More design resources on ray casting
- Touch: Direct interaction through touch
- Grab: Object manipulation through grab
- Grab specs: Technical specifications for grab
Explore more design guidelines and learn how to design great experiences for your app: