Verse Library verse

01 Fragment

Moves a prop upward or downward when a button is pressed or released.

verse-library/using-prop-mover-devices-in-fortnite-creative/01-fragment.verse

# This is a simple Verse script for a Prop Mover
# Think of this as the "brain" of the motor

# Define the Prop Mover as an Object
# An Object is like a container for all the mover's settings
MyPropMover := PropMover.Create(
    Target=MyPlatform, # The object we want to move
    Speed=500.0,       # How fast it moves (units per second)
    Direction=Up       # Which way it goes
)

# This function runs when the button is pressed
# It's called an "Event Handler" because it waits for an event
OnButtonPressed := func():
    MyPropMover.Activate() # Tell the mover to start moving

# This function runs when the button is released
OnButtonReleased := func():
    MyPropMover.Deactivate() # Tell the mover to stop

# When the game starts, we connect the button to these functions
# This is called "Binding"
Button.OnActivate += OnButtonPressed
Button.OnDeactivate += OnButtonReleased

Comments

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