# Error : Must be an array, map, or generator after ':' inside \`for\`

**URL:** <https://forums.unrealengine.com/t/error-must-be-an-array-map-or-generator-after-inside-for/2675667>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [November 16, 2025, 9:38pm UTC](https://forums.unrealengine.com/t/error-must-be-an-array-map-or-generator-after-inside-for/2675667 "2025-11-16T21:38:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yoshiyuki\_101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Yoshiyuki\_101](https://forums.unrealengine.com/u/Yoshiyuki_101)\
**Post date:** [November 16, 2025, 9:38pm UTC](https://forums.unrealengine.com/t/error-must-be-an-array-map-or-generator-after-inside-for/2675667/1 "2025-11-16T21:38:22Z")

</div>

```auto
ComponentList := Entity.GetComponents()
for:
    Component:ComponentList
do:
    Print("done")

It does not work.

```

---

<div class="post-metadata">

**Author:** ![Mineblo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mineblo/32/1203575_2.png) [@Mineblo](https://forums.unrealengine.com/u/Mineblo)\
**Post date:** [November 16, 2025, 10:06pm UTC](https://forums.unrealengine.com/t/error-must-be-an-array-map-or-generator-after-inside-for/2675667/2 "2025-11-16T22:06:12Z")

</div>

Seems to work for me:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/2/87205882cc107e009e57a6365442894fbe003b8f.png)

Could you possibly show the function where the error arises?

---

<div class="post-metadata">

**Author:** ![Yoshiyuki\_101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Yoshiyuki\_101](https://forums.unrealengine.com/u/Yoshiyuki_101)\
**Post date:** [November 16, 2025, 10:19pm UTC](https://forums.unrealengine.com/t/error-must-be-an-array-map-or-generator-after-inside-for/2675667/3 "2025-11-16T22:19:06Z")

</div>

using { /Verse.org }  
using { /Verse.org/Native }  
using { /Fortnite.com/Devices }  
using { /Verse.org/Simulation }  
using { /Verse.org/SceneGraph }  
using { /Fortnite.com/Characters }  
using { /Verse.org/Simulation }

# A Verse-authored component that can be added to entities

mesh\_collision\_detection\_component := class\<final\_super\>(component):

# Store the amount of damage to deal

DamageAmount : float = 900.0

```auto
OnSimulate<override>()<suspends>:void =
    if( SimEntity := Entity.GetSimulationEntity[] ):
        for (NiagaraEntity : SimEntity.FindDescendantEntitiesWithComponent(particle_system_component)):

            # Get the mesh component and ensure it has collision enabled
            if (MeshComp := mesh_component[NiagaraEntity]):
                set MeshComp.Queryable = true
                set MeshComp.Visible = true
                loop:
                    # Subscribe to entity entered events
                    CollisionEntity := MeshComp.EntityEnteredEvent.Await()

                    for:
                        Component: CollisionEntity.GetComponents()
                        FortCharacter := fort_character [Component]
                    do:
                        if(Player := player [FortCharacter.GetAgent[]]): 
                        FortCharacter.Damage (999.9)

                    Sleep(0.0)

```

---

<div class="post-metadata">

**Author:** ![Mineblo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mineblo/32/1203575_2.png) [@Mineblo](https://forums.unrealengine.com/u/Mineblo)\
**Post date:** [November 17, 2025, 12:54am UTC](https://forums.unrealengine.com/t/error-must-be-an-array-map-or-generator-after-inside-for/2675667/4 "2025-11-17T00:54:43Z")

</div>

Yep just checked and you’re right it doesnt work, seems to be an issue with the `EntityEnteredEvent.Await()` rather than the `for`

The digest states it should return an “entity” but it in fact seems to be returning `$unknown`

---

<div class="post-metadata">

**Author:** ![VysenaWoyka](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vysenawoyka/32/1003669_2.png) [@VysenaWoyka](https://forums.unrealengine.com/u/VysenaWoyka)\
**Post date:** [December 3, 2025, 1:15am UTC](https://forums.unrealengine.com/t/error-must-be-an-array-map-or-generator-after-inside-for/2675667/5 "2025-12-03T01:15:07Z")

</div>

Indeed, I have the same issue in my brand new project 😕  
I’m forced to subscribe to the event
