Verse Library verse

01 Fragment

Programmatically spawns a switch and door device, wiring them to open on touch.

verse-library/getting-started-in-fortnite-creative/01-fragment.verse

# This is a comment. It explains the code.
# We are making a door that opens.

# First, we need a door device.
My_Door := Spawn_Device<Door_Device>(Location=Player_Location)

# Next, we need a switch device.
My_Switch := Spawn_Device<Switch_Device>(Location=Player_Location)

# We connect them.
# When the switch is touched...
My_Switch.On_Touched += func():
    # ...open the door.
    My_Door.Open()

Comments

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