# Context-Sensitive Prompts and Onboarding
A prompt that still says "Press E" after the player rebound Interact to gamepad South is a lie. This series is the Unity 6000.5 path for **context-sensitive prompts** in **UI Toolkit**: the string or glyph comes from the **Input System** binding that is *actually active*, including rebinds and control-scheme changes, and it only appears when the world has something to do. It also covers Level 9's **"Leave the Training Level for Last"** - you do not author the tutorial corridor until the verbs exist.
**Target:** Unity **6000.5+**, UI Toolkit, Input System **`com.unity.inputsystem` 1.20.x**. The Unity 6000.5 package page lists **1.20.0 and 1.20.1** as released; **1.20.1** is the current released version for that Editor (the existing [[Input System]] series already targets 1.20.x). For a Quest 2 / VR prompt lesson, build in **Unity 6.3 LTS (6000.3.27f2+)** ([[0.Choosing a Unity Version]]) and prefer world-space panels from [[8.UI Toolkit for VR]] over a screen-space "Press A" that sits in the visor.
> [!warning] Code not compiled
> Scripts were checked against the Input System **1.20** "Display bindings" manual, the Unity 6000.5 `PanelRenderer` Scripting API, and the 6000.5 "Include sprites in text" UI Toolkit manual. **They have not been compiled or play-tested in Unity.**
> [!note] Verification status
> **Verified (6000.5 / Input System 1.20 docs, 2026-11-10):** Input System **1.20.1** released for 6000.5; `InputAction.GetBindingDisplayString()`, the per-binding-index overload, and the overload that also returns `deviceLayout` and `controlPath`; `InputBinding.MaskByGroup` / `GetBindingIndex`; `InputControlPath.ToHumanReadableString`; `InputSystem.IsFirstLayoutBasedOnSecond`; `PanelRenderer.RegisterUIReloadCallback` / `UnregisterUIReloadCallback` (the official way to get the `VisualElement` root in 6000.5 - there is no `rootVisualElement` property on `PanelRenderer`); UI Toolkit sprite tags in Label text (`<sprite="Asset" name="Name">`) via a Panel Text Settings default sprite asset.
> **Not verified:** exact default path of the Panel Text Settings asset in every 6000.5 template; whether your theme already has a default sprite asset; `PlayerInput.onControlsChanged` plus `InputSystem.onDeviceChange` together on a split-screen project (the worked example uses one player); icon set licensing - you must supply your own glyphs.
## Parts
| # | Note | Covers |
|---|---|---|
| 1 | [[1. Prompt Design and Leave Training for Last]] | When a prompt should exist, Level 9 onboarding, not a second input path |
| 2 | [[2. Binding Display Strings and Device Changes]] | `GetBindingDisplayString`, schemes, rebinds, refresh events |
| 3 | [[3. Glyph Prompts in UI Toolkit]] | `PanelRenderer` hookup, Image vs sprite-in-text, a PromptView |
| 4 | [[4. Context-Sensitive Prompt Volumes]] | World triggers, Interact, one prompt at a time |
| 5 | [[5. Worked Example Door Prompt]] | A locked door that says the *current* Interact binding |
| 6 | [[6. Prompt and Onboarding Pitfalls]] | Stale glyphs, "Press E" in data, tutorial-first, VR visor text |
## Design lens (Level Up!)
Level 9 in [[Level Up! (Review)]]: **"Leave the Training Level for Last"** - build the tutorial when you know the game. Foreshadowing and "show the player the goal, then the way" also apply: a prompt is a *label on a verb you already taught*, not the first time the verb exists. Level 7 (Controls): the action should happen as the button is pressed - the prompt must name the *current* control. Level 8 (HUD and icon design): a glyph has to read at a glance; if the icon fails, the text string must still work. Level 12's "show the door, then the key" is a layout rule this series will use as a worked example ([[Hazards, Traps and Key-Door Puzzles]] / [[3. Lock-and-Key Data]]). Accessibility (a later queued topic) can deepen remapping and reduced-motion; this series only insists that prompts survive a rebind and a missing icon.
## Patterns used (Game Programming Patterns)
- **Command** - the prompt shows the binding for an *action*, not a hard-coded key ([[Input System]]).
- **Observer** - device and rebind events refresh the view; the world only says "this interactable is in range."
- **Type Object** - a `PromptDefinition` (action + optional UXML) is data.
- **State** - Hidden / Visible / Locked (for "you need the key") is a small view state, not a new input map.
See [[Game Programming Patterns (Review)]].
## Related (existing)
- [[Input System]] / [[3. Runtime Rebinding]] / [[4. UI Input and XR Input]] / [[5. Worked Example Remappable Player]]
- [[UI Toolkit and Diegetic UI]] / [[2.UI Toolkit Project Setup]] / [[3.HUD and Inventory Example]] / [[8.UI Toolkit for VR]]
- [[Localization]] - prompt *sentences* can be localized; the *glyph* still comes from the binding
- [[Hazards, Traps and Key-Door Puzzles]] / [[3. Lock-and-Key Data]] - the door this prompt labels
- [[Inventory Systems]] - pickup prompts
- [[Character Controllers]] - do not put "Press Space to Jump" in a training pit you built before the jump existed
- [[Level Up! (Review)]] Levels 7, 8, 9, 12
## Sources
- Input System for 6000.5 (released 1.20.1): https://docs.unity.com/en-us/engine/6000.5/manual/packages-list/packages-all/pack-safe/com-unity-inputsystem
- Display bindings (Input System 1.20): https://docs.unity3d.com/Packages/
[email protected]/manual/display-bindings.html
- `PanelRenderer` (6000.5): https://docs.unity.com/en-us/engine/6000.5/script-reference/unityengine/uielements/panelrenderer
- Include sprites in text (6000.5): https://docs.unity3d.com/6000.5/Documentation/Manual/UIE-sprite.html
- Panel Text Settings (6000.5): https://docs.unity3d.com/6000.5/Documentation/Manual/UIE-text-setting-asset.html
- Supported rich text tags (6000.5): https://docs.unity.com/en-us/engine/6000.5/manual/uitoolkits/uielements/uie-work-with-text/uie-rich-text-tags/uie-supported-tags
See also (added 2026-11-10): [[Accessibility]] - remaps, fallback text, and subtitle scale; prompts must still show the current binding.