# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/interactable-components
# Local doc: epic-docs/documentation/en-us/uefn/interactable-components.md
# Section: Examples
using { /Verse.org }
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }
using { /Fortnite.com/Game }
# Allows a Enable/Disable state on the interactable_component
interactable_enableable_component<public> := class<final_super>(interactable_component):
# Default text to show on the UI
EnabledText<localizes> : message = "Enabled"
DisabledText<localizes> : message = "Disabled"
# Handles to cancel the subscriptions
var RoundStartedHandle<public>:?cancelable = false
var RoundEndedHandle<public>:?cancelable = false
var SucceededEventHandle<public>:?cancelable = false
# Stores the state of the interaction
var IsInteractEnabled<protected>:logic = true
OnBeginSimulation<override>():void =
# Run OnBeginSimulation from the parent class before
# running this component's OnBeginSimulation logic
(super:)OnBeginSimulation()
# Subscribes to round start/end
if (RoundManager := Entity.GetFortRoundManager[]):
RoundStartedCancelable := RoundManager.SubscribeRoundStarted(OnBeginRound)
set RoundStartedHandle = option{RoundStartedCancelable}
RoundEndedCancelable := RoundManager.SubscribeRoundEnded(OnEndRound)
set RoundEndedHandle = option{RoundEndedCancelable}
OnEndSimulation<override>():void =
# Run OnEndSimulation from the parent class before
Verse Library
verse
02 Examples
Extends interactables to auto-enable during rounds and display localized UI toggle text.
extracted-snippets/documentation/en-us/uefn/interactable-components/02-examples.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.