VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Fortnite›Materials/VFX·Up to Fortnite · Materials/VFX·57 of 211 in Materials/VFX

Detecting When The Puzzle Is Solved

By completing this step in the Tagged Lights Puzzle tutorial, you'll learn how to detect when the player solves the puzzle so you can spawn an item and prevent further interaction with the puzzle

Detecting a Solved Puzzle

This section shows how to detect when the player solves the puzzle by finding the right combination of lights. When the puzzle is solved, the Item Spawner device should be enabled so that it can spawn its item.

Follow these steps to detect when the player solves the puzzle:

  1. Add an editable item_spawner_device field named ItemSpawner to the tagged_lights_puzzle class, to represent the Item Spawner device. @editable ItemSpawner : item_spawner_device = item_spawner_device{}
  2. Next, define what state the lights should be in to solve the puzzle. Since the representation of the lights’ state is a logic array, the solved state of the lights should also be a logic array to easily compare the two. Create an editable logic array field named SolvedLightsState to the tagged_lights_puzzle class. In this example, the player must turn on all the lights to solve the puzzle, so initialize each element with the value true to represent the light being on. @editable SolvedLightsState : []logic = array{true, true, true, true}
  3. Save the file in Visual Studio Code.
  4. In the UEFN toolbar, click Build Verse Scripts to update your Verse device in the level.
  5. In the Outliner, select the tagged_lights_puzzle to open its Details panel.
  6. In the Details panel, set the Item Spawner property to the Item Spawner device that’s in the level.
  7. Next, develop the code that checks if the current LightsState matches the SolvedLightsState. Add a new method named IsPuzzleSolved() to the tagged_lights_puzzle class. This method should succeed if the puzzle is solved and fail if it’s not, to let its caller know the result of the check. This means the method should be marked as failable with the decides specifier. Since the method has the decides specifier, it must also have the transacts specifier, which means the actions performed by this method can be rolled back (as if the actions were never performed), if there’s a failure anywhere in the method.

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Materials/VFX · 57 of 211
Prev
tagged lights 4 toggling lights with buttons in verse
Next
tagged lights 6 final result for tagged lights puzzle in verse
Browse all files in this folder (A–Z)

Source

Epic Games documentation

View original

Last updated 2026-05-12T22:15:57.515597+00:00

VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse