# Checking if a device is already in an array of devices?

**URL:** <https://forums.unrealengine.com/t/checking-if-a-device-is-already-in-an-array-of-devices/2603148>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [July 13, 2025, 10:08pm UTC](https://forums.unrealengine.com/t/checking-if-a-device-is-already-in-an-array-of-devices/2603148 "2025-07-13T22:08:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikufromgatlin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mikufromgatlin/32/1061332_2.png) [@mikufromgatlin](https://forums.unrealengine.com/u/mikufromgatlin)\
**Post date:** [July 13, 2025, 10:08pm UTC](https://forums.unrealengine.com/t/checking-if-a-device-is-already-in-an-array-of-devices/2603148/1 "2025-07-13T22:08:50Z")

</div>

I have an array of NPC Spawners. This array has duplicates of the same spawner. I would like to subscribe to the `EliminatedEvent` event for each spawner only once.

As such, I have created an additional array for spawn devices that I have already tracked.

Currently I have:

```auto
var trackedSpawnDevices : []npc_spawner_device = array{}
        for (SpawnDevice : WaveData):
            if (trackedSpawnDevices.Find[SpawnDevice]):
                Print("Already here!")
            else:
                set trackedSpawnDevices += array{SpawnDevice}
                SpawnDevice.EliminatedEvent.Subscribe(OnNPCEliminated)

```

However, I get an error when I try to find the SpawnDevice in the array with Find:

> This function parameter expects a value of type tuple(comparable,comparable), but this argument is an incompatible value of type tuple(npc\_spawner\_device,npc\_spawner\_device).

I presume this means that I cannot find a device in an array this way. I then tried to loop through the array manually and check if the current item in the array is the same as the one I am checking, but it gives me a similar error.

Is this possible?

---

<div class="post-metadata">

**Author:** ![mikufromgatlin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mikufromgatlin/32/1061332_2.png) [@mikufromgatlin](https://forums.unrealengine.com/u/mikufromgatlin)\
**Post date:** [July 20, 2025, 9:16pm UTC](https://forums.unrealengine.com/t/checking-if-a-device-is-already-in-an-array-of-devices/2603148/2 "2025-07-20T21:16:58Z")

</div>

Have been tinkering with this over the past week and have still not made any progress. I have attempted further tries at my earlier implementation as well as deduping the array at its creation rather than later on.

Without some form of .Find or .AddUnique, I am at a loss.

I also sought help from the Developer Assistant; however, it keeps offering solutions that either do not appear to exist in Verse or do not work for devices.

---

<div class="post-metadata">

**Author:** ![Jelden](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jelden/32/924276_2.png) [@Jelden](https://forums.unrealengine.com/u/Jelden)\
**Post date:** [August 22, 2025, 10:49am UTC](https://forums.unrealengine.com/t/checking-if-a-device-is-already-in-an-array-of-devices/2603148/3 "2025-08-22T10:49:11Z")

</div>

Hello @mikufromgatlin, currently, Creative Devices are not comparable, so unfortunately, `Find` won’t work, however, the easiest solution is to create your own `<unique>` wrapper class, something like:

```auto
npc_spawner_unique := class<unique>():
    @editable
    NpcSpawner:npc_spawner_device = npc_spawner_device{}

```

which you can use to reference your NPC spawners:

```auto
    @editable
    NpcSpawnerUnique:npc_spawner_unique = npc_spawner_unique{}

```

and then `Find` will work:

```auto
        var trackedSpawnDevices : []npc_spawner_unique = array{}
        
        for (SpawnDevice : WaveData):
            if (Test := trackedSpawnDevices.Find[SpawnDevice]):
                Print("Already here!")
            else:
                set trackedSpawnDevices += array{SpawnDevice}
                SpawnDevice.EliminatedEvent.Subscribe(OnNPCEliminated)

```

Hope this helps!
