The Spy in the Portapotty: Mastering Orbit Cameras in UEFN
Tutorial beginner

The Spy in the Portapotty: Mastering Orbit Cameras in UEFN

Updated beginner

The Spy in the Portapotty: Mastering Orbit Cameras in UEFN

Ever played a map where you had to hide in a trash can or a tiny box, but you still needed to keep an eye on the assassins sneaking up on you? Standard cameras are either stuck in one spot (like a security guard who fell asleep) or locked to your face (like a selfie stick you can’t put down).

Enter the Orbit Camera. It’s the creative tool that lets you follow a player and let them look around freely. Think of it as giving your player a drone that’s tethered to their hip, but they control the zoom and the pan. In this tutorial, we’re going to build a "Peek-a-Boo" mechanic using an Orbit Camera. We’ll make a device that lets players hide in a prop, peek out without exposing themselves, and feel like actual spies.

What You'll Learn

  • The Orbit Camera Device: What it is and how it differs from fixed cameras.
  • Scene Graph Basics: Understanding how devices, players, and targets connect in the game world.
  • Verse Variables: Using a "switch" to toggle camera modes.
  • Building a Mini-Mechanic: Creating a functional hide-and-seek spy tool.

How It Works

To understand the Orbit Camera, you have to understand the Scene Graph.

In Fortnite Creative, the Scene Graph is like the family tree of your island. Every object (a prop, a player, a camera device) is a "node" in this tree. They have parents and children, and they know where they are relative to each other.

When you place an Orbit Camera device, you aren’t just placing a floating eye. You are creating a controller that says: "I am watching Player A, but Player A gets to decide how far back I sit and what angle I look at."

The Three Camera Types (The "View" Settings)

  1. Fixed Point Camera: The camera sits on a tripod. It doesn’t move when the player moves. Good for cutscenes, bad for gameplay.
  2. Fixed Angle Camera: The camera follows the player but is locked to their back (like standard Fortnite). You can’t look behind you without turning your character.
  3. Orbit Camera: The camera follows the player, BUT the player can rotate the view independently. Imagine holding a phone in front of you and walking forward, but you can rotate the phone 360 degrees to look at the wall behind you while still walking forward. That’s Orbit.

The "Target" Concept

In programming terms, the Orbit Camera needs a Target. A target is just a fancy word for "the thing we are watching." In this case, the target is the Player Character.

If you don’t assign a target, the camera floats in space looking at nothing. If you do assign a target, the camera attaches itself to that player’s coordinate system.

Let's Build It

We are going to create a simple Verse script that activates an Orbit Camera when a player presses a button (like entering a "spy mode").

Note: In modern UEFN, many camera behaviors are handled directly by the device settings and bindings. However, to understand the logic behind how Verse interacts with the Scene Graph, we will write a script that toggles a Boolean (a True/False switch) which controls whether the camera is "active" or "inactive."

Wait, you might ask: "Can't I just do this with bindings?" Yes, you can! But bindings are like plugging a cord into a wall. Verse is like understanding why the electricity flows. By writing this script, you learn how to control game state, which is the foundation for everything from custom loot drops to complex AI.

The Setup

  1. Place a Prop Mover or a simple Zone (call it "Spy Zone").
  2. Place an Orbit Camera device inside or near the zone.
  3. In the Orbit Camera device settings:
    • Add Players on Start: Set to Off (we’ll handle this via script).
    • Target: Leave this blank or set to "None" initially.
    • Distance: Set to something close, like 150 cm (so they can peek out of a small box).

The Verse Code

Open the Verse editor for a new device (or attach this script to an existing one). We will create a simple "Toggle Spy Mode" system.

# Spy Mode: A simple script to toggle an Orbit Camera
# Think of this as the "Brain" behind the camera switch.

using { /Fortnite.com/Devices } # Allows us to talk to devices
using { /Verse.org/Simulation } # Allows us to run game logic

# 1. DEFINE THE VARIABLE
# A "Variable" is like a loot box. It can hold different things at different times.
# Here, we create a "Boolean" variable called `is_spying`.
# Boolean = A switch that is either ON (True) or OFF (False).
# Just like a storm is either "active" or "not active."
is_spying := false

# 2. DEFINE THE FUNCTION
# A "Function" is a recipe or a machine. You put inputs in, you get outputs out.
# This function will handle the button press.
# "Event" means something happened in the game (like a button press).
On_Spy_Button_Pressed := event() {
    # Toggle the switch!
    # If is_spying is False, make it True. If True, make it False.
    # It's like healing: if you're at 100 HP, you can't heal more.
    # But here, we just flip the switch.
    is_spying := !is_spying # The "!" means "NOT". So NOT False is True.
    
    # 3. CONTROL THE DEVICE
    # We need to tell the Orbit Camera what to do.
    # In a real complex system, you would pass the Camera Device here.
    # For this tutorial, let's assume we have a reference to the camera.
    # Since we can't easily access the specific device instance in this simple snippet
    # without more setup, we'll log the state change.
    
    if (is_spying) {
        # SPY MODE ON
        # In a full script, you would now:
        # 1. Set the Orbit Camera's Target to the Player.
        # 2. Enable the Camera.
        # 3. Hide the player's first-person view.
        print("Spy Mode Activated! Look around!")
    } else {
        # SPY MODE OFF
        # Revert to normal controls.
        print("Spy Mode Deactivated.")
    }
}

# 4. BIND THE EVENT
# This connects the button press (from the device settings) to our function.
# Think of this as wiring a doorbell to your house.
# When the button is pressed, the function runs.
On_Spy_Button_Pressed.Bind(this)

Walkthrough: What Just Happened?

  1. is_spying := false: We created a variable. Imagine a light switch on the wall that is currently in the "OFF" position.
  2. On_Spy_Button_Pressed := event(): We defined a trigger. This is like the motion sensor in a bathroom. It doesn’t do anything until someone walks in.
  3. is_spying := !is_spying: This is the core logic. If the switch is OFF, turn it ON. If it’s ON, turn it OFF. This is called Toggling.
  4. The if Statement: This is a Branch. It’s like a fork in the road. "If I am spying, do X. Otherwise, do Y."

How to Actually Make It Work in UEFN

The code above is the logic. To make the camera actually move, you need to connect it to the Orbit Camera Device in the editor.

  1. Create a Verse Device: Place a "Verse Device" in your level.
  2. Paste the Script: Paste the code above into the Verse editor.
  3. Bind the Button: In the Verse Device settings, find the "On Pressed" event. Bind it to the On_Spy_Button_Pressed function.
  4. Connect the Camera:
    • This is where the Scene Graph comes in. You need to tell the script which Orbit Camera to use.
    • In a more advanced script, you would add a Device Input to the Verse Device called SpyCamera.
    • Then, in the editor, drag your Orbit Camera device into that slot on the Verse Device.
    • Inside the if (is_spying) block, you would write code to set the Target of SpyCamera to the player who pressed the button.

For now, just get the "Spy Mode Activated" message to appear when you press the button. That’s the first step to mastering the scene graph!

Try It Yourself

Challenge: Modify the script so that the message prints "Spy Mode ON" or "Spy Mode OFF" instead of just "Activated/Deactivated."

Hint: Look at the if (is_spying) block. Change the string inside the print() function. Remember, strings are just text wrapped in quotes, like "Hello World".

Bonus Challenge: Add a second variable called camera_distance. Set it to 150 when spying and 500 when not. (You’ll need to learn how to set device properties in Verse, but try searching the docs for "set device property"!)

Recap

  • Orbit Cameras let players follow a target while rotating the view freely.
  • Variables are like loot boxes or switches—they hold data that can change.
  • Functions are recipes that run when an Event happens.
  • The Scene Graph is the hierarchy that connects your devices, players, and cameras.

You now have the foundational logic for controlling camera behavior. From here, you can build complex spy mechanics, drone views, or even first-person shooters with custom camera rigs. The key is to break down the visual effect into simple programming steps: detect input, change a variable, update the device.

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/using-orbit-camera-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-orbit-camera-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/talisman-environment-template-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/orbit-camera-device-design-example-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/orbit-camera-device-design-examples-in-fortnite-creative

Verse source files

Turn this into a guided course

Add using-orbit-camera-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