using { /Fortnite.com/Devices } using { /UnrealEngine.com/Temporary/Diagnostics } # Define the component. # creative_prop_component gives us Hide() and Show() for the attached prop. DisappearingPlatformLogic := class(creative_prop_component): # How long to wait before disappearing (seconds). @editable Delay : float = 1.5 # This runs when the component starts. OnBegin() : void = # We want to listen for players stepping on this object. # We assume the Prefab has a Trigger Device tagged with tag_my_trigger. # In the editor, add the tag "tag_my_trigger" to the Trigger device # that is placed inside this Prefab. if (Trigger := GetCreativeObjectsWithTag(tag_my_trigger{})[0], TriggerDevice := trigger_device[Trigger]): # This loop waits forever for a trigger event. loop: # Await fires each time a player steps on the trigger. Agent := TriggerDevice.TriggeredEvent.Await() # Wait a tiny bit so the player registers the step. Sleep(0.1) # Hide the platform (invisible + no collision). Hide() # Wait our set time before bringing it back. Sleep(Delay) # Bring it back (visible + collision restored). Show()