Handle a Button Action
Receive a Studio action in Blueprint and update the Store after host logic succeeds.
This tutorial adds a Confirm button to StatusHud. The button requests an
operation. Blueprint validates and performs the real host change.
Create the contract
- In Studio, open Store → Action Contracts.
- Create group
Statusand actionConfirmwith no payload fields. - Select the button and choose Click → Action Contract → Status.Confirm.
- Save and wait for package
Gameplayto update.
Listen once in the Player Controller
Continue from Open CalmUI HUD → Completed in
BP_PlayerController. Add Listen for CalmUI Action with Player
Controller = Self. Select package Gameplay and action
Status.Confirm. Leave Listener Owner = Self.
Action response
Listen for CalmUI Action
CalmUI|Actions
In: Player Controller: Self · Package: Gameplay · Action: Status.Confirm
Out: On Action · Payload · Failed · Error · Listener
Set CalmUI String
CalmUI|Store
In: Player Controller: Self · Field: status.title · Value: Complete
Out: Boolean
Connect Failed → Print String using Error. Between On Action and the
setter, call your own function that validates and performs the requested host
operation. Only update status.title after it succeeds. Save the
Listener output only if you need to call Stop Listening before the Player
Controller ends. Do not create another listener every time the HUD opens.
Compile and play. Clicking Confirm should run the Blueprint function once and
refresh the displayed status after the host operation succeeds.
Advanced: read a payload
Add a contract field such as integer selectionIndex. Pass Payload to Read
CalmUI Action Integer, set Field to quantity, and branch on its Boolean
result before using Value. CalmUI validates the contract shape; your host must
still enforce permissions and numeric limits.
If the button does nothing
- Confirm the button uses an Action Contract, not only a local component event.
- Start the listener from the package load or Open node's Completed output.
- Print the listener's Failed error.
- Confirm the selected package contains
Status.Confirm. - Keep operation authority in Blueprint; Studio Preview only emits the request.
To see this button's tooltip or the Store change it should trigger without
starting PIE, add a matching entry to mocks/actions.json. See Mock Actions
in Preview.