Customize the HUD
Player UI lives in WBP_PlayerHUD. Floating score numbers use WBP_HitDamage. The game mode creates the HUD widget at runtime and switches tabs with Change Hud Tab.
HUD tab flow
Section titled “HUD tab flow”stateDiagram-v2 [*] --> Start: Level begins Start --> InGame: Start Game Btn InGame --> GameOver: On Game Over GameOver --> Start: Restart Btn Start --> [*]: Exit Game Btn
| Tab index | Panel | Visible when |
|---|---|---|
| Start | Start layout + cannon buttons | Before Start Game |
| In-game | Player HUD Panel | After Start Game |
| Game over | Game Over Panel | Lives exhausted |
Example — rename the score label
Section titled “Example — rename the score label”- Open Blueprints/Widgets/WBP_PlayerHUD.
- Select Score Count Text (in-game tab).
- Change Text from the default to
SCORE: 0or your localized string. - Compile and save — Update High Score / score logic still drives the numeric value at runtime.
Do not rename the widget unless you update every Blueprint reference.
Example — highlight high score on the start screen
Section titled “Example — highlight high score on the start screen”- Open WBP_PlayerHUD → select High Score Text.
- Set Appearance → Color and Opacity (for example gold
#FFD700). - Optionally increase Font → Size.
- Play DemoMap — start screen should show the saved high score from slot
SpaceShooterSaveGamewith your styling.
Widget reference
Section titled “Widget reference”| Widget | Updated by |
|---|---|
| Start Game Btn | Calls Start Game on BP_SpaceRockGameMode |
| Exit Game Btn | Quits the game |
| Restart Btn | Calls Restart Game on the game mode |
| Score Count Text | Game mode score updates during play |
| Asteroids Count Text | Internal Update Asteroid Count |
| Remaining Lives Text / life display | Show Life Hearts on BP_Spaceship |
| High Score Text | Update High Score after load / new record |
Cannon selection UI
Section titled “Cannon selection UI”Cannon Selection passes ECannonType into Start Game:
| UI choice | Enum | Ship component |
|---|---|---|
| Single shot | SingleShot | BP_SingleShot |
| Triple shot | TripleShot | BP_TripleShot |
Start Game calls Set Cannon Type on BP_Spaceship before Start Spaceship.
Example — floating damage colour
Section titled “Example — floating damage colour”- Open WBP_HitDamage.
- Edit the score Text widget colour and the Crit Animation track (used when
bIsCriticalis true on Show Score). - In BP_SpaceRock, critical multiplier defaults range from
1.2(Small) to1.8(ExtraLarge) on Asteroids Score Crit Multiplier — higher multiplier triggers critical popups more often when that logic runs in Show Score.
WBP_HitDamage is added with Add To Viewport, positioned via Project World To Screen, then removed after a short delay.
Test the full flow
Section titled “Test the full flow”- Save WBP_PlayerHUD and WBP_HitDamage.
- Play DemoMap.
- Walk through: start → in-game → game over → restart.
- Beat your high score once and restart the editor to confirm SpaceShooterSaveGame still loads on the start screen.