# This is a Verse Script snippet for educational purposes. # It demonstrates how Verse interacts with devices via the Scene Graph. using { /Fortnite.com/Devices } using { /Fortnite.com/Characters } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # A Verse device that listens for a trigger and activates # the Prop Manipulator to reveal the healing statue. healing_statue_manager := class(creative_device): # Bind these in the UEFN Outliner / Customize panel @editable StatuePropManipulator : prop_manipulator_device = prop_manipulator_device{} @editable StatueTriggerVolume : trigger_device = trigger_device{} # Called once when the game session starts OnBegin() : void = # Subscribe to the trigger volume's ActivatedEvent. # When a player enters the volume, OnPlayerEntered fires. StatueTriggerVolume.TriggeredEvent.Subscribe(OnPlayerEntered) # Handler: receives the agent (player) who walked into the volume OnPlayerEntered(Agent : ?agent) : void = # Activate the Prop Manipulator to show the statue. # Because the Health Powerup is parented to the statue in the # Scene Graph, it becomes visible and pickable automatically. StatuePropManipulator.Enable() # note: prop_manipulator_device does not have an Activate(agent) method; # Enable() is used to activate the manipulator device.