Core Concepts:Documentation Index
Fetch the complete documentation index at: https://docs-unity.molca.id/llms.txt
Use this file to discover all available pages before exploring further.
- Interaction to Step Wiring — Wire interaction events (XRGazeItem, XRClickableItem) directly to step trigger methods
- Flexible Triggering — Trigger PopupStep and QuestionStep using gaze, click, or manual events
- Event-Based Flow — Compose complex behaviors by wiring interaction and step events
Role
This guide covers general interaction patterns that combine existing steps and interactions:- Clickable Items as GrabStep — Use GrabStep with XRGrabInteractable for clickable object detection
- Gaze-Triggered Modals — Use XRGazeItem to trigger PopupStep or QuestionStep directly
- Composite Interactions — Chain multiple steps together via SequenceController event wiring
- Event-Based Triggering — Wire interaction events to step trigger methods for flexible control
Pattern 1: Clickable Item Detection Using GrabStep
Concept
Use GrabStep with XRGrabInteractable on a target object to create a clickable interaction pattern.Setup Steps
1. Create Clickable Target
- Create or select a GameObject as your clickable target
- Add XRGrabInteractable component (from XR Interaction Toolkit)
- Add GrabStep component for step validation
- Add ReferenceableComponent for reference system
- Configure GrabStep:
- Complete On Grab: Enable to complete immediately on grip
- Require Hold Duration: Disable (no hold needed for click)
- Allow Any Interactor: Enable for either hand
Clickable object with XRGrabInteractable and GrabStep configured for click detection.

2. Add Visual Feedback Auxiliaries
- On GrabStep, add StepObjectHighlightAuxiliary for hover feedback
- Add VRHapticAuxiliary for grip feedback
- Add StepInfo to show task in list
- Configure highlight to show when step active
GrabStep with highlight and haptic auxiliaries configured.

Expected Results
- Idle: Object shows normal appearance
- Hand Near: Highlight feedback appears (glow/outline)
- Hand In Range: Buttons/feedback indicate “clickable”
- Grip Detected: GrabStep completes, next step triggers
- Visual Response: Animation or state change on successful click
Pattern 2: Gaze-Triggered PopupStep
Concept
Use XRGazeItem to detect when the player gazes at an object for a configured dwell time, then fire an event to trigger PopupStep display.Setup Steps
1. Create Gaze Target with XRGazeItem
- Create or select a GameObject as your gaze target
- Add Collider (Box or Sphere, trigger mode optional)
- Add ReferenceableComponent for reference system
- Add XRGazeItem component
- Configure XRGazeItem:
- Required Look Time: Duration (1-2s typical)
- Look Angle Threshold: Precision angle (15° default, smaller = more precise)
- Reset Progress When Look Away: Enable to reset on look away
- Feedback UI Ref: Assign ProgressFeedbackUI (shows radial fill during gaze)
XRGazeItem configured on target object with required look time and angle threshold settings.

2. Create PopupStep
- Create or select a GameObject to hold the PopupStep component
- Add PopupStep component
- Configure PopupStep:
- Trigger Mode: Manual Trigger (will be triggered by gaze event)
- Popup Content Ref: Assign popup content
- Complete On Confirm: Enable
- Modal Manager Ref: Auto-find or assign
3. Wire XRGazeItem to PopupStep
- On the XRGazeItem component, locate onGazeComplete event
- Add callback to invoke PopupStep.TriggerPopup() (or custom trigger method)
- This fires when gaze dwell time is met
XRGazeItem onGazeComplete event wired to PopupStep trigger method.

Expected Results
- Gaze at target: ProgressFeedbackUI shows radial fill (if assigned)
- Dwell time met: XRGazeItem fires onGazeComplete event
- PopupStep triggered: Modal shows automatically without sequence dependency
- User confirms/cancels: PopupStep completes and hides
- Seamless flow: Direct gaze-to-popup interaction without step chaining
Pattern 3: Gaze-Triggered QuestionStep
Concept
Similar to Pattern 2, but use XRGazeItem to trigger QuestionStep for gaze-based assessment.Setup Steps
1. Setup XRGazeItem (for Gaze Detection)
- Create or select a GameObject as your gaze target
- Add Collider and ReferenceableComponent
- Add XRGazeItem component
- Configure:
- Required Look Time: Duration (1-2s typical)
- Look Angle Threshold: 15° (default, adjust for precision)
- Reset Progress When Look Away: Enable
- Feedback UI Ref: Assign ProgressFeedbackUI (optional)
2. Setup QuestionStep (with Manual Trigger)
- Create or select a GameObject to hold the QuestionStep component
- Add QuestionStep component
- Configure:
- Trigger Mode: Manual Trigger (will be triggered by gaze event)
- Question Data Ref: Assign question content
- Complete On Correct: Enable
- Allow Retry: Enable (if desired)
3. Wire XRGazeItem to QuestionStep
- On the XRGazeItem component, add callback to onGazeComplete event
- Wire to QuestionStep.TriggerPopup() (or custom trigger method)
- Fires when gaze dwell time is met
XRGazeItem configured and wired to QuestionStep trigger for gaze-based assessment.

Expected Results
- Gaze at target: ProgressFeedbackUI shows radial fill progress (if assigned)
- Dwell time met: XRGazeItem fires onGazeComplete event
- QuestionStep triggered: Question modal shows automatically
- Player selects answer: Answer validated and feedback shown
- Complete integration: Gaze drives entire assessment without step sequencing
Pattern 4: Composite Interaction (GrabStep → PopupStep → QuestionStep)
Concept
Build complex interactions by chaining three steps:- GrabStep — Click/interact with object
- PopupStep — Confirmation dialog appears
- QuestionStep — Assessment or choice
- Feedback — Based on answers
Setup Steps
1. Create Step Sequence
In SequenceController, add steps in order:2. Configure Each Step
GrabStep:- Target: Interactive object with XRGrabInteractable
- Auxiliaries: Highlight, Haptics, Info
- Complete On Grab: Enable
- Trigger Mode: On Activated (auto-shows after grab)
- Content: “Are you sure?”
- Complete On Confirm: Enable
- Trigger Mode: On Activated (auto-shows after confirm)
- Content: Question and answers
- Allow Retry: Optional
Sequence showing GrabStep → PopupStep → QuestionStep flow in SequenceController.

Expected Results
- Click Phase: Player grabs object
- Highlight feedback while hand near
- Haptics on grip
- Confirmation Phase: Popup appears automatically
- Player presses confirm or cancel
- If cancel: step ends, sequence stops
- If confirm: proceeds to next
- Assessment Phase: Question appears automatically
- Player selects answer
- If correct: step completes, sequence continues
- If incorrect: retry allowed (if enabled)
- Completion: All steps satisfied, next scenario begins
Troubleshooting
| Issue | Solution |
|---|---|
| GrabStep not detecting click | Verify XRGrabInteractable on target; check hand proximity detection; ensure colliders not disabled |
| PopupStep not triggered by gaze | Check XRGazeItem onGazeComplete event is wired to PopupStep.TriggerPopup(); verify Trigger Mode = Manual Trigger on PopupStep; confirm ProgressFeedbackUI assigned if feedback expected |
| Gaze not detecting properly | Verify XRGazeItem component enabled; check collider on target object; confirm Required Look Time is reasonable (0.5-3s); adjust Look Angle Threshold if too strict |
| XRGazeItem event not firing | Check onGazeComplete callback is registered in Inspector; verify head transform reference resolves (defaults to Camera.main); test gaze direction with Debug.Log |
| QuestionStep triggered but not visible | Verify QuestionStep Trigger Mode = Manual Trigger; check QuestionModalUI Canvas is active; ensure Modal Manager found or assigned |
| Composite sequence breaks mid-flow | Check step completion conditions (Complete On Grab, Complete On Confirm, Complete On Correct); verify all references assigned; test event wiring in Play mode |
| Multiple interactions triggering at once | Disable interactions after trigger (set disableAfterGaze = true on XRGazeItem, or disableAfterClick = true on XRClickableItem); verify only one step active at a time |
Visual Examples
Clickable Interaction Flow
Sequence showing hand approaching object, highlight feedback, grip detection, and completion.

XRGazeItem-to-Popup Flow
Sequence showing gaze at target, progress feedback, gaze dwell complete, popup appears and user confirms.

Composite Three-Step Flow
Complete flow showing click → popup confirmation → question → completion.

Related
- GrabStep — Click/grab interaction base
- XRGazeItem — Gaze detection for direct event triggering
- PopupStep — Modal confirmation patterns
- QuestionStep — Assessment and feedback patterns
- SequenceController — Sequence flow and step ordering
- VR step auxiliaries — Feedback (highlight, haptics, info)