UEFN Verse: Award Player Score and Show It On-Screen
What you'll learn
By the end of this guide you'll be able to:
- Reference a
score_manager_deviceand abutton_devicewith@editablefields - Award points to a specific
agentusingActivate(Agent)(the CURRENT method — there is noAwardon the score manager) - Read a player's live score with
GetCurrentScore(Agent) - Build a
text_blockwidget and push it to a player's HUD withGetPlayerUI[]andAddWidget - React to the manager's own
ScoreOutputEventso the UI refreshes exactly when points land
How it works
The score_manager_device owns all the scoring math. Two important corrections over the old approach:
-
There is no
Award[Player]method. The grounded signature exposesActivate()andActivate(Agent: agent). To grant points to one player you callScoreManager.Activate(Player)— with parentheses, because it returnsvoidand is not a<decides>function. UseSetScoreAward(Value)first to control how many points a single activation grants. -
GetPlayerUIandGetCurrentScoreare fallible/transacting.GetPlayerUIis declared<transacts><decides>, so it MUST be called with[]inside a failure context such as anif.GetCurrentScore(Agent)is<transacts>and returns anint, so call it with parentheses and just read the value.
The flow: a player interacts with the button → we set the award amount and Activate the manager for that player → the manager fires ScoreOutputEvent → our handler reads the new score and adds (or updates) a text_block on that player's HUD.
Let's build it
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/UI }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/UI }
# Awards points to the interacting player and shows their live score on the HUD.
score_awarder := class<concrete>(creative_device):
# The Score Manager that owns the scoring logic.
@editable ScoreManager : score_manager_device = score_manager_device{}
# Button players interact with to earn points.
@editable TriggerButton : button_device = button_device{}
# How many points each button press grants.
@editable PointsToAward : int = 10
# Tracks the text widget we created per player so we can update instead of stacking new ones.
var ScoreWidgets : [player]text_block = map{}
OnBegin<override>()<suspends> : void =
# Button press awards points; manager confirms via ScoreOutputEvent, which drives the UI.
TriggerButton.InteractedWithEvent.Subscribe(OnButtonPressed)
ScoreManager.ScoreOutputEvent.Subscribe(OnScoreAwarded)
Print("Score Awarder ready.")
# Runs when a player interacts with the button.
OnButtonPressed(Agent : agent) : void =
# Configure how much the next activation grants, then award to THIS agent (parens: returns void).
ScoreManager.SetScoreAward(PointsToAward)
ScoreManager.Activate(Agent)
# Runs when the manager confirms points were awarded to an agent.
OnScoreAwarded(Agent : agent) : void =
# GetCurrentScore is <transacts> and returns an int - call with parens, read directly.
NewScore := ScoreManager.GetCurrentScore(Agent)
# player is a subtype of agent; narrow it so we can use it as a HUD/map key.
if (Player := player[Agent]):
ShowScore(Player, NewScore)
# Adds a fresh text_block to the player's HUD, or updates the existing one.
ShowScore(Player : player, Score : int) : void =
ScoreText := TextToDisplay(Score)
if (Existing := ScoreWidgets[Player]):
# Reuse the widget already on screen - just refresh its text.
Existing.SetText(ScoreText)
else if (PlayerUI := GetPlayerUI[Player]):
# No widget yet: build one, remember it, and add it to this player's HUD.
NewText := text_block{DefaultText := ScoreText}
if (set ScoreWidgets[Player] = NewText):
PlayerUI.AddWidget(NewText)
# Builds the on-screen message from the current score.
TextToDisplay<localizes>(Score : int) : message = "Score: {Score}"
Try it yourself
- Place a Score Manager device, a Button device, and your Verse-authored
score_awarderdevice on the island. - On the Score Manager, set Score Award Type to Add so activations accumulate.
- Select the Verse device and assign the Score Manager to
ScoreManagerand the button toTriggerButton. - Adjust
PointsToAwardin the Details panel (default 10) to taste. - Launch a session, walk up to the button, and interact. Watch the score readout appear on your HUD and climb with every press.
Recap
- Grant points with
ScoreManager.Activate(Agent)— parentheses, because it returnsvoid; there is noAwardmethod on the score manager. - Use
SetScoreAward(Value)to set how many points a single activation awards. GetCurrentScore(Agent)is<transacts>and returns anint; call it with parens and read the result.GetPlayerUI[Player]is<transacts><decides>— always call it with[]inside anif.- Build a
text_block, keep it in a[player]text_blockmap, and reuse it viaSetTextso widgets don't stack up. ScoreOutputEventfires when the manager actually awards points, giving you a reliable moment to refresh the HUD.
Check your understanding
Test yourself with an interactive quiz and track your progress + earn XP — free for members.
Turn this into a guided course
Add Awarding Player Score via Score Manager Device to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.