powerup_device: Grant Buffs and Track Their Timers
The powerup_device is the base for Fortnite's pickup buffs — health orbs, shields, speed, damage amplifiers. With Verse you can spawn it on demand, grant it straight to a player, read how long the buff has left, and react the instant someone scoops it up. This guide drives the real API end to end.
What you'll learn
- How to spawn and despawn a
powerup_devicefrom Verse instead of relying on editor triggers. - How to grant a buff directly to a player with
Pickup(Agent)and check it withHasEffect. - How to read the live remaining time of a buff with
GetRemainingTime. - How to react the moment any agent picks up the powerup off the ground via
ItemPickedUpEvent.
How it works
powerup_device is the shared abstract base behind Fortnite's collectible buffs — Health Powerup, Damage Amplifier, and friends. Because it's abstract you place a concrete powerup in your level and reference it, but every method below works on all subclasses.
The key surface, resolved from the live digest:
| Member | Signature | Notes |
|---|---|---|
Spawn |
Spawn():void |
Places the powerup into the world so players can grab it. |
Despawn |
Despawn():void |
Removes it from the world. |
IsSpawned |
IsSpawned()<transacts><decides>:void |
Fallible — call inside if/for with []. |
SetDuration |
SetDuration(Time:float):void |
Clamped to the device Min/Max; won't touch already-applied effects. |
GetDuration |
GetDuration()<transacts>:float |
Returns a plain float — call with (). |
Pickup |
Pickup(Agent:agent):void |
Grants the buff directly to that agent. |
GetRemainingTime |
GetRemainingTime(Agent:agent)<transacts>:float |
-1.0 = infinite, 0.0 = agent doesn't have it. |
HasEffect |
HasEffect(Agent:agent)<transacts><decides>:void |
Fallible — use if (Powerup.HasEffect[Agent]):. |
ItemPickedUpEvent |
listenable(agent) |
Fires with the agent who picked it up. |
Watch the effect specifiers: IsSpawned and HasEffect end in <decides>, so you call them with [] inside a failure context. GetRemainingTime and GetDuration return a real float, so you call them with () and read the value — calling them with [] would not compile.
Let's build it
We build a reward-orb objective: stepping on a finish plate spawns the powerup (if needed), stretches its duration, and grants it straight to that player. When anyone picks a powerup up off the ground, we announce who got it and how many seconds of buff remain.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# Drives a concrete powerup (Health / Damage Amplifier) from Verse as a reward orb.
reward_orb := class(creative_device):
# A concrete powerup placed in the level (e.g. Health Powerup or Damage Amplifier).
@editable
RewardPowerup : health_powerup_device = health_powerup_device{}
# A trigger standing in for "challenge complete".
@editable
FinishPlate : trigger_device = trigger_device{}
OnBegin<override>()<suspends>: void =
# React whenever a player steps on the finish plate.
FinishPlate.TriggeredEvent.Subscribe(OnFinished)
# React whenever ANY agent scoops the powerup off the ground.
RewardPowerup.ItemPickedUpEvent.Subscribe(OnPickedUp)
# Triggered param is ?agent, so bind it before use.
OnFinished(MaybeAgent : ?agent): void =
if (Agent := MaybeAgent?):
# Make sure the orb is in the world; Spawn is fallible-free but IsSpawned decides.
if (RewardPowerup.IsSpawned[]):
Print("Reward orb already spawned.")
else:
RewardPowerup.Spawn()
# Stretch the buff to 30s (clamped to the device's Min/Max), then read it back.
RewardPowerup.SetDuration(30.0)
Duration := RewardPowerup.GetDuration() # returns float -> use ()
Print("Reward duration set to {Duration}s.")
# Grant the buff straight to the player who finished.
RewardPowerup.Pickup(Agent)
# Confirm the effect actually landed (HasEffect decides -> use []).
if (RewardPowerup.HasEffect[Agent]):
Print("Buff applied directly to finisher.")
# ItemPickedUpEvent sends the agent that picked it up.
OnPickedUp(Agent : agent): void =
# GetRemainingTime returns a float: -1.0 infinite, 0.0 none.
Remaining := RewardPowerup.GetRemainingTime(Agent)
if (Remaining < 0.0):
Print("Player grabbed the orb: infinite duration buff!")
else:
Print("Player grabbed the orb: {Remaining}s of buff remaining.")```
## Try it yourself
- Swap the referenced powerup between a Health Powerup and a Damage Amplifier — the same code drives both because they share the `powerup_device` base.
- Add a second `@editable trigger_device` that calls `RewardPowerup.Despawn()` to pull the orb out of the world when a timer expires.
- In `OnPickedUp`, iterate `GetPlayspace().GetPlayers()` and only announce for players who *don't* already have the effect using `if (not RewardPowerup.HasEffect[OtherAgent]):`.
- Use `SetDuration` with a very large value and confirm the device clamps it to its editor-defined Max via the value returned by `GetDuration()`.
## Recap
You drove a `powerup_device` entirely from Verse: `Spawn`/`IsSpawned` to place it, `SetDuration`/`GetDuration` to control its timer, `Pickup(Agent)` to grant it directly, `HasEffect`/`GetRemainingTime` to inspect a player's buff, and `ItemPickedUpEvent` to react to grabs. The one rule to remember: `<decides>` methods (`IsSpawned`, `HasEffect`) use `[]` inside a failure context, while methods that return a `float` (`GetDuration`, `GetRemainingTime`) use `()` and are read as values.
Guides & scripts that use powerup_device
- What's New in UEFN 41.20UEFN 41.20's Verse API surface, from a true file-to-file comparison of the v41.10 and v41.20 digests: 128 new members, 3 changed, 77 removed — and the headline is a full overhaul of the NPC AI-conversation API, with the …
- The "Glass Cannon" Power-Up: Building a Damage Amplifier in VerseImagine picking up a glowing orb that turns your weak pistol shots into sniper-rifle-level devastation for 15 seconds. That’s the thrill of a Damage Amplifier. In Fortnite Creative, this is usually just a device you drag…
- Squad Up: The Ultimate Guide to Setting Up Teams in Fortnite CreativeSo, you want to build a battle royale? Or maybe a 2v2 arena shooter? Or perhaps a chaotic free-for-all where everyone is everyone’s enemy? Before you can start dropping players into the storm, you need to organize them i…
- The Infinite Medkit: Building a Self-Respawning Health Station in VerseSo, you’ve built a map. It’s awesome. But then you realize your players are dying in one hit and quitting because there’s no way to recover. In standard Fortnite, you hunt for a medkit or a chug jug. In your island, you …
- The "Don't Die" Button: Building a Custom Health PowerupYou’ve been wiped. Again. You’re lying in the dirt, watching your health bar hit zero, while the enemy team loots your corpse and laughs. It’s time to stop being a walking loot bag and start being a healing god.
Build your own lesson with powerup_device
Generate a personalized, compile-checked lesson grounded in this exact reference.
Build a lesson →