Verse Library verse

01 Fragment

Activates an orbit camera for a hiding player to secretly observe opponents.

verse-library/add-the-orbit-camera-device/01-fragment.verse

# This is our main script. It runs when the game starts.
using { /Fortnite.com/Devices }
using { /Verse.org/Sim }

# We create a script called HideAndSeekCamera.
# This script will control our camera.
hide_and_seek_camera := script class (IScript) {

    # This is a "Device" variable.
    # It holds the Orbit Camera we placed in the level.
    # Think of it like a handle to grab the camera.
    orbit_camera_device : OrbitCameraDevice

    # This is an "Event". It triggers when a player starts hiding.
    # We will connect this to the Portapotty later.
    OnPlayerStartHiding := event (player : Player) {
        # Here is the magic! We tell the camera to activate.
        # Only the player who is hiding will see this view.
        orbit_camera_device.Activate(player)
    }

    # This runs when the game begins.
    OnBegin<override>()<suspends> : void {
        # We wait for the game to start properly.
        # Then we are ready to hide!
        print("Hide and Seek is ON! Hide well!")
    }
}

Comments

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