Overview
The ball_spawner_device is a Creative device that spawns physics-based ball props into your island. Beyond the ball itself, the device can display floating HUD icons — small on-screen markers that help players locate or track the ball. These icons are configured entirely in the device's Details panel in UEFN; Verse gives you two runtime controls:
ShowHUD()— makes the configured HUD icons visible to all players.HideHUD()— removes those icons from every player's screen.
This is useful whenever you need the HUD to match game state: hide the ball indicator during a pre-round countdown, show it the moment play begins, or suppress it entirely during a cinematic.
API Reference
ball_spawner_device
Used to spawn various types of balls. Can be used to control HUD elements related to the spawned balls.
Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse).
ball_spawner_device<public> := class<concrete><final>(creative_device_base):
Methods (call these to make the device act):
| Method | Signature | Description |
|---|---|---|
ShowHUD |
ShowHUD<public>():void |
Shows the floating HUD Icons to players, if these have been configured by the device. |
HideHUD |
HideHUD<public>():void |
Hides the floating HUD Icons from players, if these have been configured by the device. |
Walkthrough
Scenario: A soccer-style mini-game. When the round starts a countdown timer runs. While the timer counts down, the ball's HUD icon is hidden so players focus on the countdown. The moment the timer succeeds (reaches zero), the HUD icon appears so players can see where the ball is. When the timer fails (time's up without a goal), the icon is hidden again.
ball_hud_round_manager := class(creative_device):
# Wire this to your Ball Spawner device in the Details panel.
@editable
BallSpawner : ball_spawner_device = ball_spawner_device{}
# Wire this to a Timer device configured as a countdown.
@editable
RoundTimer : timer_device = timer_device{}
OnBegin<override>()<suspends> : void =
# Hide the HUD at the start — players shouldn't see the
# ball indicator until the round is actually live.
BallSpawner.HideHUD()
# Subscribe to the timer's success event (countdown reached zero
# = round is live) and failure event (time ran out = round over).
RoundTimer.SuccessEvent.Subscribe(OnRoundStart)
RoundTimer.FailureEvent.Subscribe(OnRoundEnd)
# Kick off the countdown.
RoundTimer.Start()
# Called when the countdown finishes successfully — round is live!
OnRoundStart(MaybeAgent : ?agent) : void =
# Reveal the floating ball HUD icon so players can find the ball.
BallSpawner.ShowHUD()
# Called when the timer runs out — round is over.
OnRoundEnd(MaybeAgent : ?agent) : void =
# Hide the HUD again to clean up the screen between rounds.
BallSpawner.HideHUD()
Line-by-line breakdown:
| Lines | What's happening |
|---|---|
@editable BallSpawner |
Declares the ball_spawner_device reference. You drag your placed device onto this slot in the Details panel. |
@editable RoundTimer |
A timer_device that drives the round countdown. |
BallSpawner.HideHUD() |
Immediately suppresses the HUD icon when the island loads, before any round begins. |
RoundTimer.SuccessEvent.Subscribe(OnRoundStart) |
Listens for the timer reaching zero (success = round live). |
RoundTimer.FailureEvent.Subscribe(OnRoundEnd) |
Listens for time running out (failure = round over). |
RoundTimer.Start() |
Begins the countdown. |
OnRoundStart / OnRoundEnd |
Handler methods at class scope — they call ShowHUD and HideHUD respectively. Both accept ?agent because timer_device events send an optional agent. |
Common patterns
Pattern 1 — Hide HUD during a cinematic, restore it after
Suppress the ball indicator while a cinematic sequence plays, then bring it back automatically when the sequence stops.
ball_cinematic_hud_controller := class(creative_device):
@editable
BallSpawner : ball_spawner_device = ball_spawner_device{}
@editable
Cinematic : cinematic_sequence_device = cinematic_sequence_device{}
OnBegin<override>()<suspends> : void =
# Subscribe to the cinematic's stopped event.
Cinematic.StoppedEvent.Subscribe(OnCinematicStopped)
# Hide the ball HUD and play the opening cinematic.
BallSpawner.HideHUD()
Cinematic.Play()
# Fired when the cinematic sequence finishes or is stopped.
OnCinematicStopped(Unused : tuple()) : void =
# Cinematic is done — show the ball HUD so gameplay can begin.
BallSpawner.ShowHUD()
Pattern 2 — Toggle HUD based on a player entering a damage volume
Show the ball HUD only while a player is inside a special "active zone". When they leave, hide it again.
ball_zone_hud_controller := class(creative_device):
@editable
BallSpawner : ball_spawner_device = ball_spawner_device{}
# A Damage Volume (or any effect volume) that marks the active play area.
@editable
ActiveZone : damage_volume_device = damage_volume_device{}
OnBegin<override>()<suspends> : void =
# Start with the HUD hidden.
BallSpawner.HideHUD()
# Subscribe to agents entering and exiting the zone.
ActiveZone.AgentEntersEvent.Subscribe(OnAgentEntersZone)
ActiveZone.AgentExitsEvent.Subscribe(OnAgentExitsZone)
OnAgentEntersZone(Agent : agent) : void =
# A player stepped into the active zone — reveal the ball HUD.
BallSpawner.ShowHUD()
OnAgentExitsZone(Agent : agent) : void =
# Player left the zone — hide the ball HUD.
BallSpawner.HideHUD()
Gotchas
1. HUD icons must be configured in the Details panel first.
ShowHUD() and HideHUD() only affect icons that you have already set up in the ball_spawner_device's properties inside UEFN. If you haven't configured any HUD icons in the device settings, these calls do nothing visible — there's no error, just silence.
2. ball_spawner_device has NO events.
Unlike many Creative devices, ball_spawner_device exposes zero listenable events in Verse. You cannot subscribe to "ball spawned" or "ball scored" from this device directly. Drive your logic from other devices (timers, triggers, damage volumes) and call ShowHUD/HideHUD in response to those.
3. ShowHUD/HideHUD are global — they affect ALL players.
There is no per-player overload. Calling HideHUD() removes the icon from every player's screen simultaneously. If you need per-player HUD control, you'll need to architect that with other UI devices.
4. Always declare the device as an @editable field.
You cannot write ball_spawner_device{}.ShowHUD() inline and expect it to control the placed device on your island. The @editable annotation is what binds your Verse variable to the actual placed instance. Forgetting it means you're calling methods on a detached default object with no effect.
5. No <suspends> needed.
Both ShowHUD() and HideHUD() are plain void methods with no effects — they return immediately. You do not need to await them or call them inside a sync block.