> For the complete documentation index, see [llms.txt](https://plugn-play.gitbook.io/ultimate-dice-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plugn-play.gitbook.io/ultimate-dice-system/input-and-hud.md).

# Input and HUD

Use the demo controls or connect your own UI to the player's thrower.

For the keyboard and PS5 controller shortcuts side by side, see [Demo Build](https://plugn-play.gitbook.io/ultimate-dice-system/demo-build.md#default-controls).

## Current default controls

The Data Asset's **Basic Settings** category holds the initial values for the settings changed by these controls. Batch-count limits are in **Advanced → Dice Count**; size limits and adjustment step are in **Advanced → Dice Size**.

The mappings are in `Blueprints/Input/IMC_Dice`. Each action uses its **Started** execution output, so a press requests one action rather than repeatedly firing every frame.

| Key               | Input Action             | Effect                                                   |
| ----------------- | ------------------------ | -------------------------------------------------------- |
| Left mouse button | IA\_ThrowDice            | Throw the selected batch.                                |
| 1                 | IA\_DecreaseDiceSize     | Reduce the size of the next dice.                        |
| 2                 | IA\_IncreaseDiceSize     | Increase the size of the next dice.                      |
| 3                 | IA\_ToggleCanRoll        | Enable or disable new throws.                            |
| 4                 | IA\_ForcedSelection      | Wait for a keyboard selection of the forced face.        |
| 5                 | IA\_ToggleRollLock       | Toggle waiting for previous rolls to finish.             |
| 6                 | IA\_TogglePrivateResults | Toggle private results for this player's future batches. |
| 7                 | IA\_ToggleUnknownRolling | Toggle the unknown appearance while rolling.             |
| 8                 | IA\_ToggleCleanup        | Toggle automatic cleanup for future dice.                |
| 9                 | IA\_ToggleRollCamera     | Toggle the tracking camera.                              |
| Up Arrow          | IA\_IncreaseDice         | Increase the number of dice in the next batch.           |
| Down Arrow        | IA\_DecreaseDice         | Decrease the number of dice in the next batch.           |

## Select a forced result

Press **4**, then press a keyboard number **1–6**. The selection is used for subsequent throws until changed. Any other keyboard key resets the selection to **0**, meaning a normal roll.

For example, press **4**, then **6**, then left mouse button to throw dice that finish on six. To return to normal, press **4**, then **0**.

While waiting for the selection, normal dice actions are suppressed. The capture uses a non-consuming **Any Key** event for keyboard keys and digital gamepad buttons. The key that opens the selection is not also accepted as the choice in the same frame. See [controller face selection](https://plugn-play.gitbook.io/ultimate-dice-system/demo-build.md#force-a-result) for the button layout.

**Enable Unknown when Forcing** automatically turns unknown rolling on when selecting a valid forced value. Returning to normal does not automatically turn unknown rolling off; use **7** if you want to reveal numbers during the next roll.

## HUD buttons

`WBP_DiceHUD` provides buttons for the same size, count and feature controls. Its indicators reflect the current thrower state, and its numeric slots show the selected size, count and forced value.

The HUD calls the same input handler used by the keyboard actions. It does not own a separate copy of the gameplay settings.

Under **Appearance → HUD**, **Show Dice HUD** controls creation of this widget. **Show Throw History** and **Show Leaderboard** control their panels separately.

## Control strip sizing

The bottom controls use a shrink-to-fit layout. When space is available, the strip keeps its normal design size. When the viewport is too narrow, such as at a 4:3 aspect ratio, the entire strip scales down proportionally and stays bottom-centered. The three rows keep their spacing and arrangement rather than wrapping into a different layout.

In `WBP_DiceHUD`, the hierarchy is `HUD_Scaler` → `HUD_Sizer` → the existing Canvas Panel and its three rows.

* **HUD\_Scaler:** Scale to Fit, with Stretch Direction set to Down Only. Its outer Canvas slot stretches across the full viewport with zero offsets and Size to Content disabled.
* **HUD\_Sizer:** Width Override **1920**, Height Override **380**. These are reference dimensions in UMG layout units, not a forced on-screen pixel size.
* **Alignment:** The Size Box is centered horizontally and aligned to the bottom inside the Scale Box; its inner Canvas fills the Size Box.

Unreal's project DPI scaling still applies. The Scale Box adds downscaling only when the available layout area is smaller than the reference dimensions. The history and leaderboard panels are outside this control-strip wrapper.

## Rebinding

Edit the key mappings in `IMC_Dice` to change the shortcuts. Keep the existing Input Actions connected to the thrower's **Inputs** graph. The mapping context is installed for the owning local player at priority **0**.

The demo's displayed key labels are static. If you change the mappings, update those labels in `WBP_DiceHUD` as well.

The demo pawn's movement is separate from these Dice actions. Your own pawn can keep its existing movement input.

## Use your own UI

Hold a reference to the correct player's `BP_DiceThrower`. The shared `HandleDiceInputAction` function accepts these action strings:

| Action string                       | Use                            |
| ----------------------------------- | ------------------------------ |
| ThrowDice                           | Request a throw.               |
| DecreaseDice / IncreaseDice         | Change batch size.             |
| DecreaseDiceSize / IncreaseDiceSize | Change uniform dice scale.     |
| ToggleCanRoll                       | Enable or disable rolling.     |
| SelectForcedResult                  | Start keyboard face selection. |
| ToggleRollLock                      | Toggle waiting for completion. |
| TogglePrivateResults                | Toggle private results.        |
| ToggleUnknownRolling                | Toggle unknown rolling.        |
| ToggleCleanup                       | Toggle cleanup.                |
| ToggleRollCamera                    | Toggle the roll camera.        |

Call these on the owning player's local thrower. Server RPCs inside the existing flow handle authoritative changes.

The input lock and forced-selection state can block these actions. For a simple external throw request, use the interface workflow on [Blueprint Integration](https://plugn-play.gitbook.io/ultimate-dice-system/blueprint-integration.md).
