add_xr_interactor
Add XR interaction components to a GameObject for selection and manipulation using ray casting or direct touch. Supports different interactor types and hand associations.
Instructions
Adds XR interaction components to a GameObject. Interactors enable selection and manipulation of XR Interactables via ray casting or direct touch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hand | No | Which hand this interactor is associated with | None |
| lineType | No | Ray visual line type | Straight |
| rayWidth | No | Ray visual width in meters | |
| rayLength | No | Ray interactor max length in meters | |
| enableHaptics | No | Enable haptic feedback | |
| rayValidColor | No | Ray color when hovering valid target (hex) | #00FF00 |
| interactorType | Yes | Type of interactor to add | |
| attachTransform | No | Create attach point transform for grabbed objects | |
| rayInvalidColor | No | Ray color when hovering invalid target (hex) | #FF0000 |
| targetGameObject | Yes | Instance ID, name, or path of the GameObject to add interactor to | |
| selectActionTrigger | No | How select action triggers | StateChange |