Verse Library verse

01 Fragment

Toggles visibility of prop groups to switch between different visual themes during gameplay.

verse-library/humanities-arts-and-design-lesson-plans-in-fortnite-creative/01-fragment.verse

# We need to import the basic tools to talk to the game world
using { /Fortnite.com/Devices }
using { /UnrealEngine.com temporary/Engine }

# This is our main script, attached to the island
# Think of this as the "Game Master" entity
# It holds the state of the game
[CreateByRef]
var MainGame: {
    # This variable is our "Current Theme"
    # It’s like your current weapon slot. 
    # We start with "Medieval" (represented by 0)
    CurrentTheme: int = 0

    # This function is the "Rebirth Van"
    # It takes no input, but it changes the world
    # It's a "procedure" because it does something rather than returns a value
    ApplyTheme() -> void:
        # First, we hide the current theme
        # If CurrentTheme is 0, we hide Medieval_Props
        # If CurrentTheme is 1, we hide Cyber_Props
        # We use a simple check, like deciding which path to take at a fork in the road
        if (CurrentTheme == 0):
            # Get the Medieval props group
            # We assume we have a reference to this entity in our editor setup
            # In a real build, you'd link this via the editor's "Variable" tab
            Medieval_Props.SetVisibility(Visibility: Hidden)
            
            # Now, show the Cyber props
            # This is like swapping your shield potion for a chug splash

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