Start the React dev server
Your HUD is a normal Vite project. Pick a starting point: scaffold a fresh one, or run one of the bundled examples.
Path A — Scaffold a new project (recommended)
npm create unreal-react-hud@latest my-hud
cd my-hud
pnpm install
pnpm devThe scaffolder produces a Vite + TypeScript project with the unreal-react-bridge SDK already wired through UnrealBridgeProvider. You get a working useReactState example, the devtools panel, and the ready handshake out of the box.
- CLI source:
web/cli/in the plugin source tree. - npm: https://www.npmjs.com/package/create-unreal-react-hud.
Why a scaffolder
The boilerplate is small but easy to typo (provider order, channel name, ready-event listener). Scaffolding skips a class of "why is nothing arriving" bugs.
Path B — Run an example from this repo
cd web/sdk/examples/multi-hud
pnpm install
pnpm devFour runnable examples live under web/sdk/examples/:
| Example | What it shows |
|---|---|
basic-hud | Minimal useReactState + a single push from BP |
chat-system | Chat-mode focus toggle (Enter / Esc) |
game-menu | Pause menu pattern with route navigation |
multi-hud | Four anchored layers driven by one BP event each |
Each example ships its own pnpm dev script and serves on http://localhost:5173 by default.
Configure the URL in UE
The dev server URL is read from one of two places, in order:
- Per-widget override. Open your
WBP_MyHUD→ Class Defaults → setURL. This wins whenever it is non-empty. - Project-wide default. Project Settings → Plugins → Unreal React Bridge → Default Dev URL. Used when a widget's
URLis empty.
For the full list of settings (queue size, devtools, logging), see Project Settings.