Create a Coin Collecting System with UI in Unreal Engine

Here’s a short step-by-step (Blueprint-only):

  1. Player Variable
  • Open your Character BP → add int CoinCount (default 0).
  1. 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 (optionally Format Text: “Coins: {CoinCount}”).
  1. Add UI to Screen
  • In Your Character Event BeginPlay: Create Widget (WBP_CoinUI)Add to Viewport.
  1. Coin Blueprint
  • Create BP_Coin (Actor).
  • Add StaticMesh (coin model) + Sphere Collision + (optional) Rotating Movement.
  • Add int CoinValue (default 1).
  1. Coin Collision Settings
  • Sphere → Collision: OverlapOnlyPawn (or OverlapAllDynamic), Generate Overlap Events = true.
  1. Pickup Logic
  • In BP_Coin → Sphere.OnComponentBeginOverlap:
    • Cast to YourCharacterGet CoinCount → + CoinValue → Set CoinCount.
    • (Optional) Play Sound / Spawn Niagara.
    • Destroy Actor.
  1. 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.)