Unity XR Interaction Toolkit Skills
Requirements
com.unity.xr.interaction.toolkit (≥ 3.4). Recipes target XRI 3 API only. If missing, install via Unity_PackageManager_ExecuteAction with operation=Add, package=com.unity.xr.interaction.toolkit, version=3.4.1.
When to Use
Use this module for XR Interaction Toolkit setup and configuration.
Hard rule: Read this file before the first xr_* call in a session. Wrong property names can fail silently because the bridge is reflection-based.
Common Mistakes
DO NOT (common hallucinations):
XRHand, XRPlayer, XRTeleporter, GrabInteractor, VRController, XRLocomotion, and XRManager are not the runtime classes you want here
interactable.OnGrab() / OnRelease() are not the XRI event model -> use selectEntered / selectExited
controller.vibrate() is not the documented route here -> configure haptics through xr_configure_haptics
- Do not assume physics Layer or Tag replaces
InteractionLayerMask
- Do not guess component property names — they are set via reflection. Use the skill parameters directly
Correct class names to anchor on:
XRInteractionManager
XROrigin
XRRayInteractor
XRDirectInteractor
XRSocketInteractor
XRGrabInteractable
XRSimpleInteractable
TeleportationProvider
TeleportationArea
TeleportationAnchor
ContinuousMoveProvider
SnapTurnProvider
ContinuousTurnProvider
TrackedDeviceGraphicRaycaster
XRUIInputModule
TrackedPoseDriver
Routing:
- For non-XR Canvas UI creation -> use
ui
Quick Reference
Setup and Diagnostics
| Skill |
Use |
Key parameters |
xr_check_setup |
Validate XR package, rig, managers, and scene prerequisites |
verbose? |
xr_setup_rig |
Create XR Origin + camera + controllers |
name, cameraYOffset? |
xr_setup_interaction_manager |
Add or find manager |
none |
xr_setup_event_system |
Replace/add XR UI input stack |
none |
xr_get_scene_report |
Report scene-side XR status |
none |
Interactors and Interactables
| Skill |
Use |
Key parameters |
xr_add_ray_interactor |
Remote pointing / ray interaction |
name, maxDistance?, lineType? |
xr_add_direct_interactor |
Close-range hand grab |
name, radius? |
xr_add_socket_interactor |
Snap-to slot |
name, showHoverMesh?, recycleDelay? |
xr_add_grab_interactable |
Rigidbody + collider + grab config |
name, movementType?, throwOnDetach? |
xr_add_simple_interactable |
Hover/select without grab |
name |
xr_configure_interactable |
Fine-tune interactable behavior |
target + changed fields only |
xr_list_interactors |
List all scene interactors |
none |
xr_list_interactables |
List all scene interactables |
none |
Locomotion and XR UI
| Skill |
Use |
Key parameters |
xr_setup_teleportation |
Add teleport provider to XR Origin |
none |
xr_add_teleport_area |
Mark a surface as teleportable |
name, matchOrientation? |
xr_add_teleport_anchor |
Create a stationary teleport destination |
name, x/y/z, rotY?, matchOrientation? |
xr_setup_continuous_move |
Add stick locomotion |
moveSpeed?, enableStrafe?, enableFly? |
xr_setup_turn_provider |
Add snap or smooth turn |
turnType, turnAmount?, turnSpeed? |
xr_setup_ui_canvas |
Convert Canvas for XR interaction |
name |
Feedback and Filtering
| Skill |
Use |
Key parameters |
xr_configure_haptics |
Set hover/select vibration |
name, intensities, durations |
xr_add_interaction_event |
Wire interaction callback to target method |
name, eventType, targetName, targetMethod |
xr_configure_interaction_layers |
Set InteractionLayerMask |
name, layers, isInteractor |
Workflow Summary
Rig Setup
- Run
xr_check_setup.
- Create the rig with
xr_setup_rig.
- Ensure XR UI input exists with
xr_setup_event_system.
- Add at least one interactor per controller.
Grab Setup
- Direct hand grab:
xr_add_direct_interactor + xr_add_grab_interactable
- Distance grab:
xr_add_ray_interactor + xr_add_grab_interactable
- Socket placement:
xr_add_socket_interactor + grabbable object
movementType defaults matter:
VelocityTracking: best general-purpose physical grab
Kinematic: use for handles/tools that should not get stuck
Instantaneous: best for precise remote grab
Locomotion Setup
- Teleport:
xr_setup_teleportation + xr_add_ray_interactor + xr_add_teleport_area/xr_add_teleport_anchor
- Continuous locomotion:
xr_setup_continuous_move
- Turn:
xr_setup_turn_provider
Comfort default: snap turn + moderate move speed (~2.0 m/s).
XR UI
- Convert Canvas with
xr_setup_ui_canvas
- Ensure
xr_setup_event_system
- Add a ray interactor on the controller that should click UI
Events and Haptics
Event types for xr_add_interaction_event: selectEntered, selectExited, hoverEntered, hoverExited, firstSelectEntered, lastSelectExited, activated, deactivated.
Haptic defaults: selectIntensity=0.5, selectDuration=0.1, hoverIntensity=0.1, hoverDuration=0.05.
Collider Configuration Matrix
This is the most important XR anti-hallucination table.
| Component |
Collider required |
isTrigger |
Recommended collider |
Reason |
XRDirectInteractor |
Yes |
True |
SphereCollider (0.1-0.25) |
Overlap detection |
XRRayInteractor |
No |
- |
None |
Uses raycasts |
XRSocketInteractor |
Yes |
True |
SphereCollider (0.1-0.3) |
Snap zone |
XRGrabInteractable |
Yes |
False |
BoxCollider or convex MeshCollider |
Physics + ray target |
XRSimpleInteractable |
Yes |
False |
BoxCollider |
Selection detection |
TeleportationArea |
Yes |
False |
MeshCollider or BoxCollider |
Surface raycast target |
TeleportationAnchor |
Yes |
False |
Thin BoxCollider |
Point raycast target |
Critical rules:
XRGrabInteractable needs a Rigidbody.
- A grabbable collider must not be trigger.
- A direct interactor collider must be trigger.
- Dynamic mesh colliders must be convex.
- Socket colliders should be trigger-only overlap zones.
Version Compatibility
| Topic |
XRI 2.x |
XRI 3.x |
| Main namespace style |
root namespace |
split sub-namespaces |
| Rig type |
XROrigin |
XROrigin |
| Locomotion core |
LocomotionSystem |
LocomotionMediator |
| Controller type |
ActionBasedController |
ActionBasedController |
| Bridge behavior |
Reflection helper falls back automatically |
Reflection helper prefers 3.x first |
C# Templates
Recipe path rule: ../../recipes/xr/<command>.md
See ../../recipes/xr/<command>.md for C# templates.
Important Notes
- Scenes should normally have exactly one
XRInteractionManager.
- Most locomotion skills assume an
XROrigin already exists.
- Package installation or reconfiguration can trigger Domain Reload. Wait before retrying XR calls.
- Use
InteractionLayerMask for interactor/interactable filtering.
- For custom XR scripts, prefer XRI lifecycle hooks and events over
Update() polling when possible.
1---2name: unity-xr3description: Use when users want to set up XR rigs, add grab interactions, configure teleportation, continuous locomotion, XR UI, or diagnose XR scenes. Requires com.unity.xr.interaction.toolkit 3.x on Unity 6+.4---56# Unity XR Interaction Toolkit Skills78## Requirements910- `com.unity.xr.interaction.toolkit` (≥ 3.4). Recipes target XRI 3 API only. If missing, install via `Unity_PackageManager_ExecuteAction` with `operation=Add`, `package=com.unity.xr.interaction.toolkit`, `version=3.4.1`.1112## When to Use1314Use this module for XR Interaction Toolkit setup and configuration.1516> **Hard rule**: Read this file before the first `xr_*` call in a session. Wrong property names can fail silently because the bridge is reflection-based.1718## Common Mistakes1920**DO NOT** (common hallucinations):21- `XRHand`, `XRPlayer`, `XRTeleporter`, `GrabInteractor`, `VRController`, `XRLocomotion`, and `XRManager` are not the runtime classes you want here22- `interactable.OnGrab()` / `OnRelease()` are not the XRI event model -> use `selectEntered` / `selectExited`23- `controller.vibrate()` is not the documented route here -> configure haptics through `xr_configure_haptics`24- Do not assume physics Layer or Tag replaces `InteractionLayerMask`25- Do not guess component property names — they are set via reflection. Use the skill parameters directly2627**Correct class names to anchor on**:28- `XRInteractionManager`29- `XROrigin`30- `XRRayInteractor`31- `XRDirectInteractor`32- `XRSocketInteractor`33- `XRGrabInteractable`34- `XRSimpleInteractable`35- `TeleportationProvider`36- `TeleportationArea`37- `TeleportationAnchor`38- `ContinuousMoveProvider`39- `SnapTurnProvider`40- `ContinuousTurnProvider`41- `TrackedDeviceGraphicRaycaster`42- `XRUIInputModule`43- `TrackedPoseDriver`4445**Routing**:46- For non-XR Canvas UI creation -> use `ui`4748## Quick Reference4950### Setup and Diagnostics5152| Skill | Use | Key parameters |53|-------|-----|----------------|54| `xr_check_setup` | Validate XR package, rig, managers, and scene prerequisites | `verbose?` |55| `xr_setup_rig` | Create XR Origin + camera + controllers | `name`, `cameraYOffset?` |56| `xr_setup_interaction_manager` | Add or find manager | none |57| `xr_setup_event_system` | Replace/add XR UI input stack | none |58| `xr_get_scene_report` | Report scene-side XR status | none |5960### Interactors and Interactables6162| Skill | Use | Key parameters |63|-------|-----|----------------|64| `xr_add_ray_interactor` | Remote pointing / ray interaction | `name`, `maxDistance?`, `lineType?` |65| `xr_add_direct_interactor` | Close-range hand grab | `name`, `radius?` |66| `xr_add_socket_interactor` | Snap-to slot | `name`, `showHoverMesh?`, `recycleDelay?` |67| `xr_add_grab_interactable` | Rigidbody + collider + grab config | `name`, `movementType?`, `throwOnDetach?` |68| `xr_add_simple_interactable` | Hover/select without grab | `name` |69| `xr_configure_interactable` | Fine-tune interactable behavior | target + changed fields only |70| `xr_list_interactors` | List all scene interactors | none |71| `xr_list_interactables` | List all scene interactables | none |7273### Locomotion and XR UI7475| Skill | Use | Key parameters |76|-------|-----|----------------|77| `xr_setup_teleportation` | Add teleport provider to XR Origin | none |78| `xr_add_teleport_area` | Mark a surface as teleportable | `name`, `matchOrientation?` |79| `xr_add_teleport_anchor` | Create a stationary teleport destination | `name`, `x/y/z`, `rotY?`, `matchOrientation?` |80| `xr_setup_continuous_move` | Add stick locomotion | `moveSpeed?`, `enableStrafe?`, `enableFly?` |81| `xr_setup_turn_provider` | Add snap or smooth turn | `turnType`, `turnAmount?`, `turnSpeed?` |82| `xr_setup_ui_canvas` | Convert Canvas for XR interaction | `name` |8384### Feedback and Filtering8586| Skill | Use | Key parameters |87|-------|-----|----------------|88| `xr_configure_haptics` | Set hover/select vibration | `name`, intensities, durations |89| `xr_add_interaction_event` | Wire interaction callback to target method | `name`, `eventType`, `targetName`, `targetMethod` |90| `xr_configure_interaction_layers` | Set InteractionLayerMask | `name`, `layers`, `isInteractor` |9192## Workflow Summary9394### Rig Setup95961. Run `xr_check_setup`.972. Create the rig with `xr_setup_rig`.983. Ensure XR UI input exists with `xr_setup_event_system`.994. Add at least one interactor per controller.100101### Grab Setup102103- Direct hand grab: `xr_add_direct_interactor` + `xr_add_grab_interactable`104- Distance grab: `xr_add_ray_interactor` + `xr_add_grab_interactable`105- Socket placement: `xr_add_socket_interactor` + grabbable object106107`movementType` defaults matter:108- `VelocityTracking`: best general-purpose physical grab109- `Kinematic`: use for handles/tools that should not get stuck110- `Instantaneous`: best for precise remote grab111112### Locomotion Setup113114- Teleport: `xr_setup_teleportation` + `xr_add_ray_interactor` + `xr_add_teleport_area`/`xr_add_teleport_anchor`115- Continuous locomotion: `xr_setup_continuous_move`116- Turn: `xr_setup_turn_provider`117118Comfort default: snap turn + moderate move speed (`~2.0 m/s`).119120### XR UI1211221. Convert Canvas with `xr_setup_ui_canvas`1232. Ensure `xr_setup_event_system`1243. Add a ray interactor on the controller that should click UI125126### Events and Haptics127128Event types for `xr_add_interaction_event`: `selectEntered`, `selectExited`, `hoverEntered`, `hoverExited`, `firstSelectEntered`, `lastSelectExited`, `activated`, `deactivated`.129130Haptic defaults: `selectIntensity=0.5`, `selectDuration=0.1`, `hoverIntensity=0.1`, `hoverDuration=0.05`.131132## Collider Configuration Matrix133134This is the most important XR anti-hallucination table.135136| Component | Collider required | `isTrigger` | Recommended collider | Reason |137|----------|-------------------|-------------|----------------------|--------|138| `XRDirectInteractor` | Yes | **True** | SphereCollider (`0.1-0.25`) | Overlap detection |139| `XRRayInteractor` | No | - | None | Uses raycasts |140| `XRSocketInteractor` | Yes | **True** | SphereCollider (`0.1-0.3`) | Snap zone |141| `XRGrabInteractable` | Yes | **False** | BoxCollider or convex MeshCollider | Physics + ray target |142| `XRSimpleInteractable` | Yes | **False** | BoxCollider | Selection detection |143| `TeleportationArea` | Yes | **False** | MeshCollider or BoxCollider | Surface raycast target |144| `TeleportationAnchor` | Yes | **False** | Thin BoxCollider | Point raycast target |145146Critical rules:1471. `XRGrabInteractable` needs a `Rigidbody`.1482. A grabbable collider must **not** be trigger.1493. A direct interactor collider **must** be trigger.1504. Dynamic mesh colliders must be convex.1515. Socket colliders should be trigger-only overlap zones.152153## Version Compatibility154155| Topic | XRI 2.x | XRI 3.x |156|------|---------|---------|157| Main namespace style | root namespace | split sub-namespaces |158| Rig type | `XROrigin` | `XROrigin` |159| Locomotion core | `LocomotionSystem` | `LocomotionMediator` |160| Controller type | `ActionBasedController` | `ActionBasedController` |161| Bridge behavior | Reflection helper falls back automatically | Reflection helper prefers 3.x first |162163## C# Templates164165Recipe path rule: `../../recipes/xr/<command>.md`166167*See `../../recipes/xr/<command>.md` for C# templates.*168169## Important Notes1701711. Scenes should normally have exactly one `XRInteractionManager`.1722. Most locomotion skills assume an `XROrigin` already exists.1733. Package installation or reconfiguration can trigger Domain Reload. Wait before retrying XR calls.1744. Use `InteractionLayerMask` for interactor/interactable filtering.1755. For custom XR scripts, prefer XRI lifecycle hooks and events over `Update()` polling when possible.