Unity technical documentation Version 1.2.0
Display Step Canvas
World-space instruction panels and button choices for VR Builder steps, built for Quest with XR Interaction Toolkit. Every step shares a styled model prefab and only sets its own title, body, and button labels.
com.themetrics.vrbuilder.display-step-canvas · Unity 6 (6000.0) or newer
Requirements
- Unity 6 (6000.0) or newer.
- VR Builder 5.8 or newer.
- XR Interaction Toolkit 3.0 or newer.
- uGUI 2.0 with TextMesh Pro, which ships with Unity 6.
No MRTK packages are required. The package includes third-party notices for code adapted from MRTK3 and the XRI Starter Assets.
Quick start
-
Create the prefab
Tools → TheMetrics → VR Builder → Elegant Step Canvas Builder. Pick a palette and a movement mode, then click Save as New Prefab. The prefab is registered in
Resources/DisplayStepCanvas/SimpleCanvasConfigautomatically. -
Use the included prefabs
The package already includes
CanvasDialogUIandCanvasDialogUI_StaticSide. -
Show it on a step
In a VR Builder step, Add Behavior → Canvas → Display Canvas. Set the title and body. Enter Play. The canvas appears in front of the user and closes when its button is pressed.
-
Validate
Tools → TheMetrics → VR Builder → Validate Step Canvas Setup. It checks the config and the model prefabs (
StepCanvasView, a world-space canvas, an XR raycaster, and movement) and looks for an XR UI Input Module in the open scene.
Behaviors and conditions
| Menu | Type | What it does |
|---|---|---|
| Canvas/Display Canvas | Behavior | Shows instructions. It does not advance the step by itself. |
| Canvas/Canvas Buttons | Condition | One or more buttons. Completes on Any or All of the buttons marked completing. |
| Canvas/Different Choice | Condition | Completes when the user presses a button that does not complete the step, the “wrong” answer. |
Display Canvas. Title and Body replace the model texts. The body supports rich text and \n. Button Label is optional: leave it empty to keep the prefab label. Close Mode has two values. On Any Click waits until the user presses the button or the close (X). On Deactivate finishes at once and the canvas stays until the step ends. Canvas Model picks a prefab when the config lists more than one.
Canvas Buttons. One entry per button, and you mark which ones complete the condition. Any: one completing button is enough. All: the user must press every completing button, like a checklist. The close (X) button is hidden, so the user always has to choose.
Different Choice uses two transitions on the same step. Transition A carries only Canvas Buttons (the correct answer). Transition B carries only Different Choice (the wrong answer, for example a remediation). Do not put both conditions on one transition. VR Builder requires every condition on a transition, so neither path could fire. The inspector shows an error when it detects that layout.
Any Non-Completing reacts to every button not marked completing. Specific Buttons reacts only to the ticked buttons. Different Choice listens only to the Canvas Buttons of its own step, so parallel steps can each show their own question.
Examples
- Confirm to continue. One Canvas Buttons entry, “Continue”, marked completing.
- Multiple choice. Easy, Normal, and Hard, all completing, mode Any. To remember the choice, write it to a Training Blackboard variable and branch later.
- Correct or wrong. On transition A, “Wear PPE” (completing), “Skip PPE” and “Ignore warning” (not completing). On transition B, Different Choice set to Any Non-Completing.
- A tip during a task. Display Canvas with Close Mode set to On Deactivate, plus your grab or place condition on the transition.
Movement and custom prefabs
Movement is a component on the model prefab, chosen in the builder.
- Tag Along:
StandaloneFollow. Stays inside a view cone and a distance range, with smoothing. - Face User:
SimpleFaceUser. Stays still and glides back in front when the user turns away more than the Recenter Angle or walks away. Yaw-only rotation. The cheapest option on Quest. - Spawn In Front:
SimpleFaceUserwith Follow After Spawn off. Appears in front, then stays. - Fixed panel: use
CanvasDialogUI_StaticSide.SidePanelCanvasPlacementmoves it to a scene object namedCanvasSideAnchorand keeps it facing the user.
A custom model prefab needs a StepCanvasView with Title and Body as TextMesh Pro. A template button is required for Canvas Buttons; the close button is optional. The Canvas is world-space with a TrackedDeviceGraphicRaycaster. On the SimpleCanvasConfig inspector, Add poke support to prefab adds poke and poke affordances. The prefab has to be listed in SimpleCanvasConfig.
To design it in the Scene view: GameObject → TheMetrics → VR Builder → Add Step Canvas Here, then save it as a prefab. At runtime, clones of the template button go into its layout group, or into an automatic grid when there is none.
Multiplayer
Canvases are local to each player. They follow that player’s camera, and button clicks are not networked. If VR Builder runs on every client, as in the Unity VR Multiplayer template, each player sees and answers their own canvas.
When one player’s answer has to drive everyone’s process, write it to a networked Training Blackboard variable and branch on that variable.
Verbose Logging on SimpleCanvasConfig logs button subscriptions and choices. It is off by default, and the validator warns when it is left on.
Common problems
“No model prefab configured”
Run Elegant Step Canvas Builder, or assign a prefab in SimpleCanvasConfig.
Buttons cannot be pressed
Add an EventSystem with an XR UI Input Module, and make sure the canvas has a Tracked Device Graphic Raycaster. Then run the validator.
The condition never completes
Mark at least one button as completing.
Different Choice never fires
There must be non-completing buttons, and the two conditions belong on separate transitions of the same step.
The canvas does not follow the user
The model prefab needs Standalone Follow or Simple Face User, and the scene needs an active camera tagged MainCamera.
Text is missing
Import TMP Essential Resources.
An old process fails to load
Tools → TheMetrics → VR Builder → Migrate Legacy DisplayStepCanvas Process Types. A runtime type binder also handles the old type names.