using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /Verse.org/Verse } # This script makes the floor disappear when a player steps on it. # We attach this script to a Trigger Volume device. VanishingFloorTrigger := class(creative_device): # 1. The Trigger Volume itself (the device we attached this script to) @editable this_device: trigger_device = trigger_device{} # 2. A reference to the floor prop we want to hide/show # We will link this in the editor! @editable floor_to_hide: creative_prop = creative_prop{} # 3. How long the floor stays hidden (in seconds) hide_duration: float = 3.0 # This function runs when the script initializes (when the game starts) OnBegin(): void = # We don't need to do anything special here yet, # but we could set up initial states. this_device.TriggeredEvent.Await() OnBeginOverlap() # This function is called when a player enters the trigger volume OnBeginOverlap(): void = # Great, a player stepped on us! # 1. Hide the floor # This tells the floor's mesh to stop rendering. floor_to_hide.Hide() # 2. Wait for the specified duration # The script pauses here. The player falls through! Sleep(hide_duration) # 3. Bring the floor back # This tells the floor's mesh to start rendering again. floor_to_hide.Show()