Creating Win Conditions and Ending the Game

In this lesson you'll learn to

  • ✓Explain what a win condition is and why every game needs one
  • ✓Use an End Game Device to stop a Fortnite island when a player wins
  • ✓Subscribe to the EliminatedEvent to count player eliminations in Verse
  • ✓Check an elimination count against a winning number and trigger the End Game Device

🏆 What Is a Win Condition?

Every game has a moment when someone wins. In checkers, you win when you take all your opponent's pieces. In a race, you win when you cross the finish line first.

In Fortnite, your island needs the same thing — a rule that says "You did it! Game over!"

That rule is called a win condition. It's just an if-then idea:

If something happens enough times → then end the game and celebrate the winner!


🧩 The Pieces We Need

Think of building this like a LEGO set. We need three pieces:

Piece What It Does
EliminatedEvent Tells our code every time a player is eliminated
A counter (variable) Keeps score — it counts up each elimination
End Game Device The magic button that actually ends the round

📦 What Is a Variable?

A variable is like a scoreboard that changes during the game.

Imagine a whiteboard in gym class. You erase the old score and write a new one every time a team scores. That whiteboard is a variable — it changes!

In Verse, we write var in front of a variable name to say "hey, this number is allowed to change."

var EliminationCount : int = 0   # starts at zero, like a fresh scoreboard

int just means the value is a whole number (like 0, 1, 2, 3 — not 1.5).


🔔 What Is an Event Subscription?

Imagine you sign up for text alerts from a pizza place. Every time a new deal drops, you get a message automatically — you don't have to keep checking!

Subscribing to an event works the same way. We tell Verse:

"Hey, every time a player gets eliminated, automatically run my special function!"

That special function is called an event handler. It's the code that runs when the event happens.

We subscribe like this:

FortCharacter.EliminatedEvent().Subscribe(OnPlayerEliminated)

This says: "When this character is eliminated, call my function named OnPlayerEliminated."


🛑 What Is the End Game Device?

The End Game Device is a real UEFN device you place on your island. When your Verse code tells it to Activate, it ends the round — just like a referee blowing the final whistle!

We call it like this:

EndGameDevice.Activate(Player)

Player is who triggered the win — so Fortnite knows who to celebrate! 🎉


🗺️ Putting It All Together

Here is the big picture in plain English:

  1. When the game starts, set the winning number (like "first to 3 eliminations wins").
  2. Subscribe to the EliminatedEvent for every player.
  3. Every time someone gets an elimination, add 1 to the scoreboard.
  4. Check if the scoreboard reached the winning number.
  5. If YES → Activate the End Game Device → 🎉 Winner!

That's it! Let's see it in real Verse code.

🔒

Keep going — free

You've read the intro. The rest of this lesson is free for members. Sign in to continue and track your progress.

Sign in free to continue this lesson
Pass the quiz above to chart this quest in your Journal.

Sources

/docs/documentation/en-us/uefn/verse-elimination-template-in-unreal-editor-for-fortnite
Source

Biloxi Studios original lesson

Guided course

Add this lesson to your free study plan.

🧭 The Keeper’s log

Quest complete? Chart your next heading from the Build Your First Game expedition.

⛵ Take me there