How to Build a Talking NPC in Fortnite
Tutorial beginner

How to Build a Talking NPC in Fortnite

Updated beginner

How to Build a Talking NPC in Fortnite

Imagine an NPC that actually talks back to you. You walk up, it asks a question, and you answer. It feels like magic. But it is just logic.

We will build a simple conversation. An NPC will greet you. Then it will ask if you want to start the game. You click "Yes," and the game begins. You will learn how to make text boxes that players can read and click.

What You'll Learn

  • How to place a Pop-up Dialog device.
  • How to write custom text for your NPC.
  • How to link choices to game actions.
  • How to make the game wait for your answer.

How It Works

Think of a Pop-up Dialog like a speech bubble in a comic book. It appears on your screen. It stays there until you read it and click a button.

In Fortnite Creative, this device is invisible. You do not see it in the game world. It lives in the "Scene Graph." The Scene Graph is like a family tree for your island. It holds every object, from trees to triggers.

The Pop-up Dialog has two main parts. First, there is the Message. This is the text the player sees. Second, there are Choices. These are the buttons the player clicks.

When you click a choice, the device sends a signal. This signal is called an Event. An Event is like a doorbell. It tells other devices, "Hey! The player clicked something!" We can use this signal to start a timer, open a door, or spawn enemies.

Let's Build It

We will make a "Welcome Gate." When you walk through a trigger, a box appears. It asks, "Are you ready to play?" If you click "Yes," a message says, "Let's go!" If you click "No," it says, "Okay, take your time."

Step 1: Place the Device

  1. Open your island in UEFN.
  2. Open the Devices menu.
  3. Search for Pop-up Dialog.
  4. Place it anywhere. It is invisible, so just drop it on the ground.

Step 2: Write the Message

Click the Pop-up Dialog device. Look at the settings panel. Find the Message field. Type this text:

Are you ready to play?

This is what the player will see.

Step 3: Add Choices

Now we need buttons. Find the Choices section. You will see a list. Add two choices.

  • Choice 1: Type Yes.
  • Choice 2: Type No.

These are the buttons the player will click.

Step 3: Add Logic (Verse)

Now we need code. This code listens for the player's click. It uses a Function. A Function is like a recipe. It tells the computer what to do step-by-step.

Here is the code. Copy this into a Verse script attached to your Pop-up Dialog.

# This is a simple script for a Pop-up Dialog.
# It listens for player clicks.

# This function runs when the dialog is shown.
OnShow := func():
    print("Dialog is now visible to the player.")

# This function runs when a choice is clicked.
OnChoice := func(choice: string):
    # Check which button was clicked.
    if choice == "Yes":
        print("Player chose Yes! Let's start.")
        # You can add more code here to start the game.
    else if choice == "No":
        print("Player chose No. We will wait.")
    else:
        print("Unknown choice selected.")

What Does This Code Do?

  • OnShow: This part runs when the box first appears. It prints a note to the developer log. It helps you know the dialog is working.
  • OnChoice: This part runs when the player clicks a button.
  • if choice == "Yes": This checks if the "Yes" button was clicked.
  • else: This catches any other click, like "No."

Step 4: Connect It to a Trigger

The dialog won't show up by itself. We need a Trigger.

  1. Place a Trigger Volume device. Make it big enough for a player to walk into.
  2. Select the Pop-up Dialog device.
  3. In the settings, find the On Show signal.
  4. Drag the connection from the Trigger's On Player Enters signal to the Dialog's On Show signal.

Now, when you walk into the trigger, the dialog appears!

Try It Yourself

You have a working dialog! Now, make it smarter.

Challenge: Add a third choice called "Maybe." If the player clicks "Maybe," make the dialog close after 5 seconds.

Hint: You can use a Timer device. When the "Maybe" choice is clicked, start the timer. When the timer finishes, send a signal to the Pop-up Dialog to close it.

Recap

You built a talking interface! You learned that a Pop-up Dialog is an invisible device. It shows text and buttons. You learned that clicking a button sends an Event. You used Verse to listen for that Event. Your island now has interactive stories. Great job!

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/using-popup-dialog-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-pop-up-dialog-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-popup-dialog-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/onboarding-players-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/onboarding-players-in-fortnite-creative

Verse source files

Turn this into a guided course

Add using-popup-dialog-devices-in-fortnite-creative 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