# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/lights-and-bridges-01-triggerable-interface-and-scene-events-in-fortnite
# Local doc: epic-docs/documentation/en-us/fortnite/lights-and-bridges-01-triggerable-interface-and-scene-events-in-fortnite.md
# Section: Final Code for Triggerable.verse
<#
Interface for triggering an action on a component.
Any component that you want to be triggered when the touch_component has it's Touch function called
must implement this interface.
#>
using { /Verse.org/Simulation }
OnlyTriggerOnceToolTip<public><localizes>:message="Whether this triggerable component should only ever be triggered once."
SolvedStateTriggeredToolTip<public><localizes>:message="Whether this puzzle pieces solved state is the triggered state. Note: Only relevant if PuzzlePiece is set to true."
PuzzlePieceToolTip<public><localizes>:message="Whether this entity is part of a puzzle solution."
triggerable<public> := interface:
@editable:
ToolTip := OnlyTriggerOnceToolTip
OnlyTriggerOnce<protected>:logic = false
@editable:
ToolTip := SolvedStateTriggeredToolTip
SolvedStateTriggered:logic = false
# Is this a puzzle piece?
@editable:
ToolTip := PuzzlePieceToolTip
PuzzlePiece:logic = false
# Is this currently triggered?
var Triggered<public>:logic = true
var<protected> HasBeenTriggeredOnce<protected>:logic = false
# Runs when triggered
Trigger():void =
if:
(OnlyTriggerOnce? and not HasBeenTriggeredOnce?) or (not OnlyTriggerOnce?)
Verse Library
verse
09 Final Code For Triggerable Verse
Defines an interface for interactive components with trigger states, puzzle support, and action methods.
extracted-snippets/documentation/en-us/fortnite/lights-and-bridges-01-triggerable-interface-and-scene-events-in-fortnite/09-final-code-for-triggerable-verse.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.