animated_mesh_device

device
animated_mesh_device<public> := class<concrete><final>(creative_device_base)

Used to select, spawn, and configure a skeletal mesh to play a specific animation.

Module
/Fortnite.com/Devices
Source
fortnite

Used in

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 =
        ControlButton.InteractedWithEvent.Subscribe(OnPress)

    # Each press advances the transport: Play, then Pause, then PlayReverse,
    # then back to Play. The Animated Mesh device remembers its own playhead,
    # so Pause freezes mid-animation and Play resumes from there.
    OnPress(Presser : agent) : void =
        case (Step):
            0 =>
                Statue.Play()
                Print("Animated Mesh: Play")
            1 =>
                Statue.Pause()
                Print("Animated Mesh: Pause (frozen on current frame)")
            _ =>
                Statue.PlayReverse()
                Print("Animated Mesh: PlayReverse")
        # Advance, wrapping 0 -> 1 -> 2 -> 0. Verse has no `%` operator; the
        # built-in Mod[] is the failable modulo (it fails only on divide-by-zero,
        # which can't happen here). The if simply re-binds Step to the result.
        if (Next := Mod[Step + 1, 3]):
            set Step = Next
StartButton : button_device = button_device{}

    @editable
    Cine : cinematic_sequence_device = cinematic_sequence_device{}

    @editable
    Performer : animated_mesh_device = animated_mesh_device{}

    @editable
    Host : character_device = character_device{}

    @editable
    Fanfare : audio_player_device = audio_player_device{}
DanceDevice := class(creative_device):

    # This is a reference to the Animated Mesh Device placed on the island.
    # Wire it up in the User Options panel in the editor.
    @editable
    AnimatedMesh : animated_mesh_device = animated_mesh_device{}

    # This is a reference to the Trigger Device placed on the island.
    # Wire it up in the User Options panel in the editor.
    @editable
    DanceTrigger : trigger_device = trigger_device{}

    # This is a variable. It changes the speed.
    # Think of it like a volume knob for speed.
    var speed_variable : float = 1.0

    # This function runs when the game starts
    OnBegin<override>()<suspends> : void =
        # Subscribe to the trigger so OnTriggered runs when a player hits it.
        # This is like telling the doorbell to ring our function.
        DanceTrigger.TriggeredEvent.Subscribe(OnTriggered)

        # We set the animation to start at normal speed
        # This is like pressing "Play" on a music player
        AnimatedMesh.Play()

    # This function runs when the Trigger is hit
    OnTriggered(Agent : ?agent) : void =
        # We change the speed variable
        # This makes the dance faster or slower
        set speed_variable = 2.0

        # We tell the device to use the new speed
        # PlayRate accepts a float multiplier: 1.0 = normal, 2.0 = double speed
        AnimatedMesh.SetPlayRate(speed_variable)

        # We print a message to the output log
        # This is like leaving a note for the player
        Print("The dance is now fast!")
SampleVerse / Vine Attack verse-source
GroundSpikeATK := class(creative_device):

    @editable var Trigger : trigger_device = trigger_device{}

    @editable var Redicile : creative_prop = creative_prop{}

    @editable var Spike : animated_mesh_device = animated_mesh_device{}

    @editable var DamageVolume : damage_volume_device = damage_volume_device{}

    # Runs when the device is started in a running game

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

        Trigger.TriggeredEvent.Subscribe(AttackPlayer)

        # Initialize the Attack and hide it out of bounds

        DamageVolume.Disable()

        if(Redicile.TeleportTo[vector3 {X:=0.0, Y:=0.0 , Z:=0.0}, MakeRotationFromYawPitchRollDegrees(0.0, 0.0, 0.0)]):

    AttackPlayer(Agent: ?agent):void =

        # Attack random player, could potentially be expanded to multiple

        AllPlayers := GetPlayspace().GetPlayers()

        Shuffle(AllPlayers)

        if (Player : player = AllPlayers[0]):

            # Start the attack sequence on a new thread

            spawn{Attack(Player)}

    Attack(TargetPlayer: player)<suspends>:void=

        # Get the player's character and location
NpcSystem / Npc Prop Speaking verse-source
get_speaking_prop := struct<concrete>:
    @editable
    Prop:?creative_prop = false
    @editable
    CharacterDevice:?character_device = false
    @editable
    AnimatedMesh:?animated_mesh_device = false
    

speaking_prop := class(creative_device):
    Logger : log = log{Channel := log_npc_prop_speaking}

    @editable
NpcSystem / GoDoDevice verse-source
get_anim_seq := struct<concrete>():
    @editable
    ByName: ?string = false
    @editable
    ByFile: ?[]animation_sequence = false
    @editable
    ByDevice: ?animated_mesh_device = false
    @editable
    ByCharacter: ?character_device = false
    @editable
    Settings: anim_settings = anim_settings{}

anim_settings := struct<concrete>():