Verse Library verse

13 5 1 Limit Single Line Failable Expressions Count T

Iterates over tagged actors to conditionally turn light devices on or off based on state.

extracted-snippets/documentation/fortnite/verse-code-style-guide-in-unreal-editor-for-fortnite/13-5-1-limit-single-line-failable-expressions-count-t.verse

# Source URL: https://dev.epicgames.com/documentation/fortnite/verse-code-style-guide-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/fortnite/verse-code-style-guide-in-unreal-editor-for-fortnite.md
# Section:    5.1 Limit single line Failable Expressions count to three
set Lights = for:
ActorIndex -> TaggedActor : TaggedActors
LightDevice := customizable_light_device[TaggedActor]
ShouldLightBeOn := LightsState[ActorIndex]
do:
if (ShouldLightBeOn?) then LightDevice.TurnOn() else LightDevice.TurnOff()
LightDevice

Comments

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