Verse Library verse

03 Device

Defines a Verse creative device to cycle animation states via a button press.

verse-library/verse-skel-animated-mesh/03-device.verse

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

# PRESS TO PERFORM — drive a skeletal mesh from Verse.
#
# The Animated Mesh device is the creator-friendly door to skeletal animation.
# You can't hand-build an `animation_sequence` in Verse code (those are
# editor-imported assets, and the play_animation_controller that consumes them
# is epic_internal). What you CAN do is pick a skeletal mesh and an animation
# IN THE EDITOR on an Animated Mesh device, then drive its playback from Verse
# with Play / Pause / PlayReverse.
#
# This device turns one Button into a full transport panel for a posed statue,
# a dancing hologram, a swinging gate — any skeletal mesh you drop on the
# Animated Mesh device. First press plays, next pauses, next reverses, and so on.
skel_performer_device := class(creative_device):

    # The skeletal-mesh performer. Choose its mesh + animation in the editor.
    @editable
    Statue : animated_mesh_device = animated_mesh_device{}

    # One button cycles through Play -> Pause -> Reverse.
    @editable
    ControlButton : button_device = button_device{}

    # Which state the next press should APPLY. Starts at "play".
    var Step : int = 0

    OnBegin<override>()<suspends> : void =

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