using { /Fortnite.com/Devices } using { /UnrealEngine.com/Temporary/Diagnostics } # Declare a tag so we can find the Trigger device inside the Prefab by name. # In the UEFN editor, assign this tag to the Trigger device that sits # inside the DisappearingPlatform Prefab. tag_my_trigger := class(tag) {} # creative_prop_component is the real base class for Verse components # that control a creative prop (static mesh + collision). # Hide() makes the prop invisible and non-collidable. # Show() reverses that. Both are inherited from creative_prop_component. DisappearingPlatformLogic := class(creative_prop_component): # A variable to store how long the platform stays hidden. @editable HideDuration : float = 2.0 # This function runs when the game starts. OnBegin() : void = # Find the Trigger device inside our Prefab by its tag. if (Trigger := GetCreativeObjectsWithTag(tag_my_trigger{})[0], TriggerDevice := trigger_device[Trigger]): # Infinite loop: re-arms itself after every hide/show cycle. loop: # Block here until a player steps on the trigger. Agent := TriggerDevice.TriggeredEvent.Await() # Wait for the hide duration, then toggle visibility. Sleep(HideDuration) # Hide the parent prop (the platform itself). Hide() # Wait a moment before making it solid again. Sleep(1.0) # Show the platform again (collision re-enabled automatically). Show()