Skip to main content

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.

Core Concepts:
  • 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
These patterns enable complex multi-step interactions by combining existing components and wiring events.

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

  1. Create or select a GameObject as your clickable target
  2. Add XRGrabInteractable component (from XR Interaction Toolkit)
  3. Add GrabStep component for step validation
  4. Add ReferenceableComponent for reference system
  5. 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.

Clickable target with grab interactable and step

2. Add Visual Feedback Auxiliaries

  1. On GrabStep, add StepObjectHighlightAuxiliary for hover feedback
  2. Add VRHapticAuxiliary for grip feedback
  3. Add StepInfo to show task in list
  4. Configure highlight to show when step active

GrabStep with highlight and haptic auxiliaries configured.

Clickable step with highlight and haptic feedback

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

  1. Create or select a GameObject as your gaze target
  2. Add Collider (Box or Sphere, trigger mode optional)
  3. Add ReferenceableComponent for reference system
  4. Add XRGazeItem component
  5. 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.

XRGazeItem component with gaze detection settings

2. Create PopupStep

  1. Create or select a GameObject to hold the PopupStep component
  2. Add PopupStep component
  3. 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

  1. On the XRGazeItem component, locate onGazeComplete event
  2. Add callback to invoke PopupStep.TriggerPopup() (or custom trigger method)
  3. This fires when gaze dwell time is met

XRGazeItem onGazeComplete event wired to PopupStep trigger method.

XRGazeItem onGazeComplete event connected to PopupStep trigger

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)

  1. Create or select a GameObject as your gaze target
  2. Add Collider and ReferenceableComponent
  3. Add XRGazeItem component
  4. 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)

  1. Create or select a GameObject to hold the QuestionStep component
  2. Add QuestionStep component
  3. 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

  1. On the XRGazeItem component, add callback to onGazeComplete event
  2. Wire to QuestionStep.TriggerPopup() (or custom trigger method)
  3. Fires when gaze dwell time is met

XRGazeItem configured and wired to QuestionStep trigger for gaze-based assessment.

XRGazeItem onGazeComplete event connected to QuestionStep trigger

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:
  1. GrabStep — Click/interact with object
  2. PopupStep — Confirmation dialog appears
  3. QuestionStep — Assessment or choice
  4. Feedback — Based on answers

Setup Steps

1. Create Step Sequence

In SequenceController, add steps in order:
[Step 1: GrabStep]
  - Clickable object detection
  - Complete On Grab: Enable
  ↓ OnStepEnd fires
[Step 2: PopupStep]
  - Trigger Mode: On Activated (shows immediately)
  - Complete On Confirm: Enable
  ↓ OnStepEnd fires
[Step 3: QuestionStep]
  - Trigger Mode: On Activated (shows immediately)
  - Complete On Correct: Enable
  ↓ OnStepEnd fires
[Step 4: Completion Step or Next Scenario]

2. Configure Each Step

GrabStep:
  • Target: Interactive object with XRGrabInteractable
  • Auxiliaries: Highlight, Haptics, Info
  • Complete On Grab: Enable
PopupStep:
  • Trigger Mode: On Activated (auto-shows after grab)
  • Content: “Are you sure?”
  • Complete On Confirm: Enable
QuestionStep:
  • Trigger Mode: On Activated (auto-shows after confirm)
  • Content: Question and answers
  • Allow Retry: Optional

Sequence showing GrabStep → PopupStep → QuestionStep flow in SequenceController.

Three-step composite interaction flow

Expected Results

  1. Click Phase: Player grabs object
    • Highlight feedback while hand near
    • Haptics on grip
  2. Confirmation Phase: Popup appears automatically
    • Player presses confirm or cancel
    • If cancel: step ends, sequence stops
    • If confirm: proceeds to next
  3. Assessment Phase: Question appears automatically
    • Player selects answer
    • If correct: step completes, sequence continues
    • If incorrect: retry allowed (if enabled)
  4. Completion: All steps satisfied, next scenario begins

Troubleshooting

IssueSolution
GrabStep not detecting clickVerify XRGrabInteractable on target; check hand proximity detection; ensure colliders not disabled
PopupStep not triggered by gazeCheck XRGazeItem onGazeComplete event is wired to PopupStep.TriggerPopup(); verify Trigger Mode = Manual Trigger on PopupStep; confirm ProgressFeedbackUI assigned if feedback expected
Gaze not detecting properlyVerify 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 firingCheck 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 visibleVerify QuestionStep Trigger Mode = Manual Trigger; check QuestionModalUI Canvas is active; ensure Modal Manager found or assigned
Composite sequence breaks mid-flowCheck 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 onceDisable 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.

Complete clickable interaction with hover and click feedback

XRGazeItem-to-Popup Flow

Sequence showing gaze at target, progress feedback, gaze dwell complete, popup appears and user confirms.

XRGazeItem gaze completion triggering popup display

Composite Three-Step Flow

Complete flow showing click → popup confirmation → question → completion.

Full three-step composite interaction with all phases