Build Your First Verse Game: The Campfire Puzzle
Tutorial beginner compiles

Build Your First Verse Game: The Campfire Puzzle

Updated beginner Code verified

Build Your First Verse Game: The Campfire Puzzle

Welcome, future game creator! Are you ready to make something people can actually play?

We are going to build a simple puzzle island. You will place a secret campfire. When a player finds it, the fire lights up. It feels like magic. But it is just code!

You do not need to be a math genius. You just need to know how to place items. We will use Verse to connect them. Let's make your island come alive.

What You'll Learn

  • How to place a Trigger and a Device in Fortnite Creative.
  • What a Variable is (it is like a storage box).
  • How to write a tiny bit of Verse code to make things happen.
  • How to test your game and fix small bugs.

How It Works

Think of your island like a stage. The props are the actors. The code is the script.

In Fortnite Creative, you place objects called Devices. A device is like a smart box. It can sense things or do things.

We will use two devices:

  1. A Trigger Volume. This is an invisible box. If a player walks inside, it wakes up.
  2. A Campfire Device. This is the prop that makes fire.

We need a bridge between them. That bridge is Verse. Verse is a language for computers. It tells the Trigger to tell the Campfire to light up.

We will use a Variable. A variable is a named box. It holds one value. Imagine a box labeled "FireOn". If the box is empty, the fire is off. If we put "Yes" in it, the fire turns on.

Let's Build It

Follow these steps carefully. You are building a real game!

Step 1: Place Your Devices

  1. Open Fortnite Creative. Go to Create Mode.
  2. Search for Trigger Volume in the device menu. Place it on the ground.
  3. Make the box big enough for a player to stand in.
  4. Place a Campfire prop near the trigger. You can find it in the Props menu.
  5. Make sure the Campfire is not lit yet. It should be gray.

Step 2: Name Your Devices

This is important! The code needs to know which devices to use.

  1. Click on your Trigger Volume.
  2. In the device settings, find the Name field.
  3. Type MyTrigger. Press Enter.
  4. Click on your Campfire.
  5. In the device settings, find the Name field.
  6. Type SecretCampfire. Press Enter.

Step 3: Write the Verse Code

Now we write the magic script. We will use a Script Device. This is a special device that runs Verse code.

  1. Search for Script in the device menu. Place it anywhere.
  2. Click the Edit Script button on the device. This opens the code editor.
  3. Delete any code that is already there. We want a fresh start.
  4. Copy and paste this code exactly:
# This is a comment. It explains the code.
# We are making a script that watches for players.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# This is our main game manager class.
# It holds the devices we named earlier.
campfire_script := class(creative_device):

    # MyTrigger is our trigger volume device.
    # Connect it in the Details panel in UEFN.
    @editable
    MyTrigger : trigger_device = trigger_device{}

    # SecretCampfire is our campfire device.
    # Connect it in the Details panel in UEFN.
    @editable
    SecretCampfire : campfire_device = campfire_device{}

    # This function runs when the game starts.
    OnBegin<override>()<suspends> : void =
        # We wait for the trigger to activate.
        # This means a player walked into the box.
        MyTrigger.TriggeredEvent.Await()
        # We tell the campfire to light up.
        SecretCampfire.AddWood()```

5.  Click **Save** and then **Close**.

### Step 4: Connect the Code

The code is written, but it does not know which devices are which yet. We must connect them.

1.  Click on your **Script Device**.
2.  Look at the properties panel on the right.
3.  Find the slot labeled **MyTrigger**.
4.  Drag your **Trigger Volume** from the world into this slot.
5.  Find the slot labeled **SecretCampfire**.
6.  Drag your **Campfire** from the world into this slot.

### Step 5: Test It!

1.  Press **Play** to test your island.
2.  Walk into the invisible trigger box.
3.  Watch your campfire! It should light up with orange flames.

You did it! You built a working game mechanic.

## Try It Yourself

Great job! Now let's make it harder.

**Challenge:** Make the fire go out if the player leaves the box.

**Hint:** You can listen for a "Deactivated" event on the trigger. When that happens, set the campfire to `false`.

## Recap

You just built your first Verse game. You placed devices. You named them. You wrote code to connect them.

Remember these key ideas:
*   **Devices** are the objects in your game.
*   **Variables** are named boxes that hold data.
*   **Events** are things that happen, like a player walking in.

Keep building. Keep coding. You are a game creator now!

## References

- https://dev.epicgames.com/documentation/en-us/fortnite/campfire-device-design-example-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/fortnite-creative-glossary
- https://dev.epicgames.com/documentation/en-us/fortnite/7-construct-the-game
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/fortnite-creative-glossary
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/grind-rail-device-design-example-in-fortnite-creative

Verse source files

Turn this into a guided course

Add Build a Game 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.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in