Unity technical documentation Version 1.2.0
Directional Indicator
A world-space chevron that points toward a scene target while a VR Builder step is active. It appears only when the target is out of view, and it is removed when the step ends, is skipped, or is aborted. It belongs to the same kit as Display Step Canvas, and each folder works on its own.
com.themetrics.vrbuilder.directional-indicator · Unity 6 (6000.0) or newer
Requirements
- Unity 6 (6000.0) or newer.
- VR Builder 5.8 or newer.
- XR Core Utils, which is installed with XR Interaction Toolkit.
- URP for the default chevron material. With another pipeline, Create or Repair Default Chevron Indicator picks an available unlit shader.
No MRTK packages are required. The package includes third-party notices for code adapted from MRTK3. The namespace is TheMetrics.VRBuilderExtensions.DirectionalIndicator.
Quick start
-
Import
Import the package and wait for the scripts to compile. The default chevron and the config land in
Resources/DirectionalIndicator/. -
Add it to a step
In a VR Builder step, Add Behavior → Guidance → Directional Indicator. Set Target to a scene object that has a Process Scene Object.
-
Try it
Enter Play and look away from the target. The chevron appears when the target leaves the view.
-
Validate
Tools → TheMetrics → VR Builder → Validate Directional Indicator Setup. It checks the config, prefabs, and materials, and whether the head and controller paths exist under the XR Origin in the open scene.
The step fields are Target (the object to point toward, with a Process Scene Object), Indicator Model (which prefab to use, shown only when the config lists more than one), Reference Frame, and, when the frame is Custom Transform, Custom Reference.
Reference frames
| Frame | What it does |
|---|---|
| Prefab Default | Uses the prefab Default Reference Frame: Head, Left, or Right. Step only. |
| Head | “Look over there.” Uses the XR camera. |
| Left Controller / Right Controller | Guides that controller toward the target. Falls back to the tracked hand when there is no controller. |
| Custom Transform | A fixed scene anchor, set in Custom Reference. Step only. |
Head and controller transforms are found under the XR Origin that owns Camera.main, using the paths in PlayerRigDiscoverySettings. The defaults match the XRI rig. The lookup is cached and retried every half second while it is missing. The cache refreshes when the cached rig or camera is destroyed or disabled. Call PlayerReferenceFrameResolver.InvalidateCache() if you swap rigs some other way.
Custom prefabs
A custom prefab needs a DirectionalIndicatorVisual and at least one Renderer. Point the arrow tip along local +Y. Add the prefab to Resources/DirectionalIndicator/DirectionalIndicatorConfig. When the config lists several prefabs, each step can pick one.
- View Offset: distance from the center of the reference frame.
- Min / Max Indicator Scale: size. It grows as the target gets further off-center.
- Visibility Scale Factor: the screen margin used for the Head frame.
- Reference Visibility Angle: the view cone for controller and custom frames.
- Move / Rotate Lerp Time: smoothing.
- Default Reference Frame: the frame used when the step picks Prefab Default.
The default chevron uses ProceduralChevronMesh, a flat double-sided arrow built at runtime, with no model file. Width, height, and arm thickness are editable on the component. If the config ends up with no usable prefab, the editor rebuilds the default chevron once per session. You can also run Tools → TheMetrics → VR Builder → Create or Repair Default Chevron Indicator at any time.
Multiplayer
The indicator is local to each player. It follows that player’s camera and XR Origin and is never networked. If VR Builder runs on every client, as in the VR Multiplayer template, each player sees their own chevron.
To keep process steps in sync, drive transitions from shared state, for example networked Training Blackboard variables.
Common problems
“No indicator prefab configured”
Run Create or Repair Default Chevron Indicator.
The chevron is pink
The material shader does not match the render pipeline. Run Create or Repair Default Chevron Indicator.
“Target could not be resolved”
The target needs a Process Scene Object and a valid reference in the step.
The chevron never appears
The target may already be in view. Check the visibility angle and the margin.
The wrong hand, or no controller
Fix the paths in PlayerRigDiscoverySettings (there is a button on the config inspector) and run the validator.
An old process fails to load
Tools → TheMetrics → VR Builder → Migrate Legacy Directional Indicator Process Types. A runtime type binder also handles the old type names.