Verse Library verse

01 Fragment

Connects a switch button to a prop mover device to trigger movement animations or door mechanics.

verse-library/customize-the-prop-mover/01-fragment.verse

// This is a simple Verse script for our Secret Door

# Create a variable for our Prop Mover.
# A variable is like a labeled box for data.
my_secret_door: PropMoverDevice = PropMoverDevice{}

# Create a variable for our Switch.
my_button: SwitchDevice = SwitchDevice{}

# This function runs when the button is pressed.
# It is an "Event Handler."
on_button_press(): void =
    # Tell the door to start moving.
    my_secret_door.Start()
    
    # Optional: Play a sound here!
    # my_secret_door.PlaySound()

Comments

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