Push gameplay data to React
The Blueprint side of the events channel: push typed state to one or more HUD layers without writing JSON by hand.
End-to-end example: player:hp ticking in React
UE side
- Add a React Bridge Sender component to your character / GameMode / AI controller (any Actor).
- (Optional) Set
TargetBridgeNameto a single HUD layer'sName. Empty = broadcast. - From any BP graph, call
PushFloat:
text
Event On Health Changed (NewHP, MaxHP : float)
├─ Push Float ("player:hp", NewHP)
└─ Push Float ("player:hp:max", MaxHP)React side
tsx
import { useUnrealState } from 'unreal-react-bridge';
export function HpBar() {
const hp = useUnrealState<number>('player:hp', 100);
return <span>HP: {hp}</span>;
}Supported types
| Helper | Payload shape | Use for |
|---|---|---|
PushFloat / PushInt / PushBool / PushString | { value: v } | scalars |
PushVector | { value: { X, Y, Z } } | positions / sizes |
PushMap | flat { k1: v1, ... } | inventories, key-value bundles |
PushRaw | verbatim JSON | escape hatch |
useUnrealState auto-unwraps { value: X }
Single-key value payloads (everything except PushMap / PushRaw) unwrap automatically — no .value in your React code.
Multi-HUD routing
Set the sender's TargetBridgeName to dispatch to one layer only:
text
ReactBridgeSender on BP_PlayerCharacter
TargetBridgeName: "HpBar" ← only the HpBar layer receives PushFloat/PushMap
TargetBridgeName: "" ← broadcast to every layerSee Multi-HUD anchors for the layer-naming pattern. Reference: ReactBridgeSender.