Verse Library verse

01 Fragment

Toggles spy mode on button press to control an orbit camera.

verse-library/using-orbit-camera-devices-in-fortnite-creative/01-fragment.verse

# 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.

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

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