Verse Library verse

01 Device

Points a placed camera toward a specific player for cinematic shots.

verse-library/low-angle/01-device.verse

# Import the core Verse tools we need
using { /Verse.org/Verse }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Fortnite.com/Characters }

# This is our main "Actor" - think of it as the container for our logic.
# It's like the Battle Bus that holds all the rules for this specific game mode.
# creative_device is the real base class for Verse scripts placed in a UEFN level.
hero_angle_script := class(creative_device):

    # A VARIABLE is a container that holds a value that can change.
    # Think of it like a loot drop: it might be a shield potion, a shotgun, or nothing.
    # Here, we store the camera device so our script knows WHICH camera to control.
    # Drag your placed Fixed Angle Camera into this slot in the Details panel.
    @editable
    CameraDevice : gameplay_camera_fixed_angle_device = gameplay_camera_fixed_angle_device{}

    # A FUNCTION is a set of instructions the computer follows.
    # Think of it like a Trap (e.g., a Spiky Trap). You trigger it, and it does a specific thing.
    # Our function "LookUpAtPlayer" will run when someone spawns.
    LookUpAtPlayer(Plr : player) : void =
        # 'Plr' is the player who just spawned.
        # We need to find where they are in the world.
        # GetFortCharacter() gives us the in-world pawn for this player.
        if (FortChar := Plr.GetFortCharacter[]):
            # GetTransform() returns position, rotation, and scale together.
            PlayerTransform := FortChar.GetTransform()

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