Verse Library verse

01 Device

Synchronously moves multiple props to choreograph synchronized dance animations.

verse-library/positioning-and-choreography/01-device.verse

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

# This is our dance floor script.
DanceFloor := class(creative_device):

    # These are our props. They are like actors on a stage.
    @editable
    crate_1: creative_prop = creative_prop{}
    @editable
    crate_2: creative_prop = creative_prop{}
    @editable
    crate_3: creative_prop = creative_prop{}

    # This function runs when the device starts up.
    OnBegin<override>()<suspends>: void =
        # We subscribe to the trigger's agent-entered event elsewhere,
        # but here we drive the dance directly on begin for simplicity.
        RunDance()

    # Moves all three crates to the center at the same time.
    RunDance()<suspends>: void =
        # We define the target spot. Let's use the center of the island.
        # vector3 is a point in 3D space.
        target_spot := vector3{X:=0.0, Y:=0.0, Z:=50.0}

        # We set the duration. 1.0 second is a good start.
        Duration := 1.0

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