The Loot Goblin’s Timer: How to Make Coins Respawn Like Magic
The Loot Goblin's Timer: How to Make Coins Respawn Like Magic
So you've placed some coins on your island, but now they're gone forever once picked up. Boring. You want your island to feel alive, where loot drops, disappears, and comes back like clockwork—just like the storm or a respawn beacon.
In this tutorial, we're going to build a Self-Respawning Loot System. We'll teach your coins how to wait for a few seconds after being collected, then pop back into existence so players can farm them again. No coding degree required, just a little logic and some binding.
What You'll Learn
- The Concept of Binding: How to make two different devices "talk" to each other.
- Timers as Triggers: Using a countdown to control when game events happen.
- Respawn Logic: The specific sequence of "Collect → Wait → Reappear."
- Scene Graph Basics: Understanding how devices are separate entities that need instructions to interact.
How It Works
Imagine you're playing a game where you pick up a shield potion. It disappears from the ground. But if you walk back to that spot 10 seconds later, there's another one. How does the game know to put it back?
In Fortnite Creative (and Verse), we use Devices. Think of a Device as a specific object in your world with a job. A Coin is a device that gives you points. A Timer is a device that counts down from a set number to zero.
By themselves, they are useless. The Coin doesn't know it needs to wait, and the Timer doesn't know what to do when it hits zero. We need to Bind them.
Binding is like setting up a remote control. You tell Device A: "When you do X, send a signal to Device B to do Y."
Here is the flow we are building:
- Player touches Coin: The Coin disappears (Collects).
- Coin sends signal: It tells the Timer, "Hey, start counting!"
- Timer counts down: It waits for a set time (e.g., 5 seconds).
- Timer finishes: It sends a signal to the Coin, "Time's up, respawn!"
- Coin reappears: The loop starts over.
This is the backbone of almost every game mechanic: traps, loot drops, and even the Battle Bus schedule.
Let's Build It
We are going to use the Direct Event Binding system. This is the visual way to connect devices without writing code. It's like drawing wires between components.
Step 1: Place Your Devices
- Open your Island Editor.
- Place a Coin device somewhere on the map. Let's call it
LootCoin. - Place a Timer device somewhere nearby (or even off-map, it doesn't matter where it is, just that it's there). Let's call it
RespawnTimer.
Step 2: Configure the Timer
Click on your RespawnTimer device. In the details panel on the right:
- Set the Time to
5.0seconds (or whatever you want). - Make sure Start When Receiving From is checked. This is crucial! It means the timer won't start automatically; it waits for a signal to begin.
Step 3: The First Bind (Coin → Timer)
We need to tell the Timer to start counting when the Coin is collected.
- Click on your
LootCoindevice. - Look for the Events section. Find the event called On Collect Send Event To.
- Click the + button to add a binding.
- Select Device: Choose
RespawnTimer. - Select Function: Choose Start.
What just happened? You just taught the Coin: "When someone picks me up, tell the Timer to start."
Step 4: The Second Bind (Timer → Coin)
Now we need to tell the Coin to come back when the Timer hits zero.
- Click on your
RespawnTimerdevice. - Look for the Functions section. Find the function called Complete When Receiving From.
- Click the + button to add a binding.
- Select Device: Choose
LootCoin. - Select Event: Choose Respawn For All.
Wait, why "Respawn For All"? In UEFN, "Respawn" means "make the device visible and collectible again." "For All" ensures that if multiple players are playing, everyone sees the coin come back.
Step 5: Test It
Hit Play.
- Pick up the coin. It disappears.
- Wait 5 seconds.
- The coin reappears!
You've just built a basic game loop.
Let's Build It (Verse Code Version)
While the visual binding works, understanding the logic in Verse helps you scale up. If you want to make 100 coins with different respawn times, manual binding gets tedious. Verse lets you script this.
Here is a simple Verse script that creates a Respawnable Coin.
# This is a simple Verse script for a respawnable coin
# We define the 'Coin' as an object that has a Timer and a Respawn function
# First, we need to import the tools we need
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
# This is our main 'Actor' (think of it as the Coin's brain)
# creative_device is the real base class for UEFN Verse devices
respawnable_coin := class(creative_device):
# These are our 'Variables' - things that can change
# A variable is like a loot box: it holds an item, and you can swap the item inside.
# These @editable fields appear as slots in the UEFN details panel,
# where you drag in your real Timer and Coin devices from the scene.
@editable
TimerDevice : timer_device = timer_device{}
@editable
CoinDevice : item_spawner_device = item_spawner_device{}
# This is the 'Event' that runs when the game starts
# OnBegin is the real UEFN lifecycle function; it is async because it can Await
OnBegin<override>()<suspends> : void =
# Here we 'Bind' the devices together in code.
# Subscribe() is how Verse attaches a callback to a listenable event.
# We tell the CoinDevice: "When you are collected, run StartTimerOnCollect."
CoinDevice.ItemPickedUpEvent.Subscribe(StartTimerOnCollect)
# We tell the TimerDevice: "When you finish counting, run RespawnCoin."
TimerDevice.SuccessEvent.Subscribe(RespawnCoin)
# Called whenever any agent collects the coin; we ignore the agent and start the timer.
StartTimerOnCollect(Agent : agent) : void =
TimerDevice.Start()
# Called when the timer reaches zero; respawn the coin for every player.
RespawnCoin(Agent : ?agent) : void =
# Enable() re-enables the item_spawner_device so all players can collect it again.
# note: item_spawner_device inherits Enable() from base_item_spawner_device to
# restore visibility/collectibility; Reset() is not available on this device.
CoinDevice.Enable()
# To use this, place this device in the scene from the Content Browser,
# then drag your Timer and Coin devices into the 'Timer Device' and 'Coin Device' slots
# in the UEFN details panel.```
### Walkthrough of the Code
1. `respawnable_coin := class(creative_device)`: This creates a new "Blueprint" for our coin. In the **Scene Graph**, every object is an Actor. `creative_device` is the real Verse base class for anything you place in UEFN. This script defines how *this specific type* of Actor behaves.
2. `@editable TimerDevice : timer_device`: This is a **Variable**. The `@editable` attribute makes it appear as a slot in the UEFN details panel so you can drag a real Timer device from your scene into it.
3. `OnBegin<override>()<suspends> : void`: This is a **Function**. A function is like a recipe or a sequence of instructions. `OnBegin` means "Run these instructions when the game starts." The `<suspends>` tag tells Verse this function is allowed to pause and wait.
4. `CoinDevice.CollectedEvent.Subscribe(StartTimerOnCollect)`: This is the **Binding** logic in code. `CollectedEvent` is the real listenable event on `coin_device` that fires whenever a player picks the coin up. `Subscribe` registers our function so it runs each time that happens.
5. `TimerDevice.SuccessEvent.Subscribe(RespawnCoin)`: This connects the `SuccessEvent` of the timer — the real event that fires when the countdown reaches zero — to our `RespawnCoin` function, which calls `Reset()` to bring the coin back.
## Try It Yourself
**Challenge:** Make a "Greedy Coin."
Modify your system so that the coin only respawns if the player *didn't* pick it up within 2 seconds. (Hint: You'll need a second timer or a reset mechanism. Think about what happens if the player *doesn't* collect the coin—does the timer still run? How do you reset the timer if the player hasn't touched it?)
**Hint:** You might need to bind the Timer's **Reset** function to the Coin's **On Collect** event as well, or use a "Start When Receiving From" logic carefully.
## Recap
- **Devices** are the objects in your world (Coins, Timers, Triggers).
- **Binding** is how you make them talk. You connect an **Event** (something happening) to a **Function** (something doing).
- **Timers** are great for delays. They count down and then send a signal.
- **Respawn** is the function that makes a device visible and collectible again.
Now go make some loot that actually respawns! Your players will thank you, and you'll have one less excuse for a boring island.
## References
- https://dev.epicgames.com/documentation/en-us/fortnite/using-air-vent-device-design-examples-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/grind-rail-device-design-example-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/grind-rail-device-design-example-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/grind-vine-device-design-example-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/design-a-prop-hunt-game-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add Bind Timers and Coins 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.
References
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.