Verse Library verse

17 Triggerable Light Component

Overrides perform action to toggle descendant light and mesh components on or off based on trigger state.

extracted-snippets/documentation/en-us/fortnite/lights-and-bridges-03-trigger-component-and-triggerable-child-classes-in-fortnite/17-triggerable-light-component.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/lights-and-bridges-03-trigger-component-and-triggerable-child-classes-in-fortnite
# Local doc:  epic-docs/documentation/en-us/fortnite/lights-and-bridges-03-trigger-component-and-triggerable-child-classes-in-fortnite.md
# Section:    Triggerable Light Component
PerformAction<override>():void=
if (not IsLightOn?):
for (DescendantEntity:Entity.FindDescendantEntities(entity), Entity = DescendantEntity.GetParent[]):
if (MeshComponent := DescendantEntity.GetComponent[mesh_component]):
if (LightComponent := DescendantEntity.GetComponent[light_component]):
MeshComponent.Enable()
LightComponent.Enable()
else:
MeshComponent.Disable()
set IsLightOn = true
set Triggered = true

Comments

    Sign in to vote, comment, or suggest an edit. Sign in