# Verse Switch State Puzzle

**URL:** <https://forums.unrealengine.com/t/verse-switch-state-puzzle/1683209>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, question, fortnite\
**Created:** [February 12, 2024, 5:02am UTC](https://forums.unrealengine.com/t/verse-switch-state-puzzle/1683209 "2024-02-12T05:02:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EDK\_707](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EDK\_707](https://forums.unrealengine.com/u/EDK_707)\
**Post date:** [February 12, 2024, 5:02am UTC](https://forums.unrealengine.com/t/verse-switch-state-puzzle/1683209/1 "2024-02-12T05:02:39Z")

</div>

Hello. I am new to verse and uefn in general and I am trying to understand it. I am having trouble following this tutorial for making an escape room game.

For the Verse Switch State Puzzle: [10. Verse Switch State Puzzle | Epic Developer Community (epicgames.com)](https://dev.epicgames.com/documentation/en-us/uefn/escape-room-10-switch-puzzle-in-unreal-editor-for-fortnite)

I am stuck on the very beginning as line 19 “item\_switch\_puzzle” apparently has an unknown identifier. I am not sure what to do since there is only a few steps to get to where I am at so I am unsure how to progress.

Thank you for your time and help, here is my code:

using { /Fortnite.com/Devices }  
using { /Verse.org/Native }  
using { /UnrealEngine.com/Temporary/Diagnostics }  
using { /Verse.org/Simulation/Tags }  
using { /Verse.org/Simulation }

# See [Create Your Own Device Using Verse in Unreal Editor for Fortnite | Fortnite Documentation | Epic Developer Community](https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse) for how to create a verse device.

# A Verse-authored creative device that can be placed in a level

## An event handler class to handle switch interactions

## This event handler is attached to events in the loop above

switch\_event\_handler := class():  
PuzzleDevice : item\_switch\_puzzle  
Switch : switch\_device

```
OnSwitchPressed(InPlayer : agent) : void =
    Print("Clicked")
    PuzzleDevice.CheckSequence(InPlayer)

```

switch\_state\_puzzle := class(creative\_device):

```
@editable
Switches : []switch_device = array{} #References the switches players can interact with

var SwitchSubscriptions : []cancelable = array{}

# Runs when the device is started in a running game
OnBegin<override>()<suspends> : void=
    
    Print("Loading Switch Puzzle")

    # Looping through each switch and adding event handlers for each switch
    for (SwitchIndex -> Switch : Switches):
        Print("Switch {SwitchIndex} added")
        Switch.TurnedOnEvent.Subscribe(switch_event_handler{PuzzleDevice := Self, Switch := Switch}.OnSwitchPressed)
        Switch.TurnedOffEvent.Subscribe(switch_event_handler{PuzzleDevice := Self, Switch := Switch}.OnSwitchPressed)

```

---

<div class="post-metadata">

**Author:** ![ok\_studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ok\_studios](https://forums.unrealengine.com/u/ok_studios)\
**Post date:** [February 13, 2024, 1:26am UTC](https://forums.unrealengine.com/t/verse-switch-state-puzzle/1683209/3 "2024-02-13T01:26:47Z")

</div>

For what it’s worth, I find the same error. I haven’t looked through the whole thing, but I’m thinking that maybe that’s a mistake, and it is supposed to say “switch\_state\_puzzle” not “item\_state\_puzzle.” When you change the name, the error goes away, and creates a new error referencing a method that class is calling but hasn’t been created yet, so that makes sense.

---

<div class="post-metadata">

**Author:** ![EDK\_707](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EDK\_707](https://forums.unrealengine.com/u/EDK_707)\
**Post date:** [February 13, 2024, 4:04am UTC](https://forums.unrealengine.com/t/verse-switch-state-puzzle/1683209/4 "2024-02-13T04:04:43Z")

</div>

Hey thank you so much such an easy fix that I missed countless times!

I have been finding a lot of slight issues with these tutorials.

I still am stuck on this first section cause now CheckSequence is being marked as an unknown member. I am assuming this is a built in verse method so maybe I am missing something to import?

Thank you again!

---

<div class="post-metadata">

**Author:** ![ok\_studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ok\_studios](https://forums.unrealengine.com/u/ok_studios)\
**Post date:** [February 13, 2024, 6:26am UTC](https://forums.unrealengine.com/t/verse-switch-state-puzzle/1683209/5 "2024-02-13T06:26:11Z")

</div>

Yes, there are some errors in the tutorials. Guess that was another one but kind of a show stopper.

The CheckSequence is a function or should I say method that you write or they have written for you. Not built-in. They want you to apparently put it in the class, the switch\_event\_handler.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [March 14, 2024, 6:26am UTC](https://forums.unrealengine.com/t/verse-switch-state-puzzle/1683209/6 "2024-03-14T06:26:16Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
