Here’s a short step-by-step (Blueprint-only):
- Player Variable
- Open your Character BP → add int
CoinCount
(default 0).
- UI Widget
- Create WBP_CoinUI → add a TextBlock (and coin icon if you want).
- Bind the Text to a function: Get Player Character → Cast to YourCharacter → Get
CoinCount
→ ToText (optionallyFormat Text
: “Coins: {CoinCount}”).
- Add UI to Screen
- In Your Character Event BeginPlay: Create Widget (WBP_CoinUI) → Add to Viewport.
- Coin Blueprint
- Create BP_Coin (Actor).
- Add StaticMesh (coin model) + Sphere Collision + (optional) Rotating Movement.
- Add int
CoinValue
(default 1).

- Coin Collision Settings
- Sphere → Collision: OverlapOnlyPawn (or OverlapAllDynamic), Generate Overlap Events = true.
- Pickup Logic
- In BP_Coin → Sphere.OnComponentBeginOverlap:
- Cast to YourCharacter → Get
CoinCount
→ +CoinValue
→ SetCoinCount
. - (Optional) Play Sound / Spawn Niagara.
- Destroy Actor.
- Cast to YourCharacter → Get
- Place Coins
- Drag BP_Coin into the level and hit Play.
✅ That’s it—UI auto-updates because it reads CoinCount
.
(Pro tip: for performance later, swap the binding for a widget function like UpdateCoins(int)
and call it right after you set CoinCount
.)