# This is a simple Verse script for the Animated Mesh Device # It makes the animation play faster when triggered using { /Fortnite.com/Devices } using { /Verse.org/Simulation } # We define our main 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() : 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!")