Verse Library verse

01 Fragment

Hides a bound platform prop at game start with error handling for unlinked references.

verse-library/1-setting-up-the-level/01-fragment.verse

# This is our main script file. Think of it as the brain of the island.

# 1. Define the Script
# This tells Verse: "I am a script that runs on this island."
script VanishingPlatformScript: island script {
    # 2. The Binding: Our "Name Tag" for the Prop
    # We create a variable called `VanishingPlatform` that expects a Prop.
    # When you place the Verse Device in the editor, you will drag your 
    # Hoverplatform into this slot in the Details Panel.
    VanishingPlatform: prop = prop{}

    # 3. The Setup Function: The "Game Start" Trigger
    # This runs automatically when the match begins.
    Setup()<suspends>: void = {
        # Check if the platform was actually bound (dragged in)
        if (VanishingPlatform != prop{}) {
            # 4. The Action: Hide the platform
            # We call the Hide() method on our prop.
            # This makes it invisible AND removes its collision 
            # (so players can walk through it).
            VanishingPlatform.Hide()
            
            # Optional: Print a message to the console for debugging
            # This is like the "Elimination Feed" for code errors.
            print("Platform is now gone! Good luck!")
        } else {
            # If you forgot to bind the prop, tell us!
            print("Error: No platform bound to the script!")
        }
    }

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