Problems with default engine macros (for each loop with break)

Hello, i am trying to make a maze generator, but i get a problem: game dont start and engine send me many error messages that link to default engine macros “for each loop with break”. I dont know what can cause a problem. I’ll attach screenshots with errors, macros, and my function that calls for each loop when it make troubles.

I am using Unreal Engine 5.4.3



1 Like

Because it’s a function, you don’t need to use foreach with break.

When you find it, you can just return it, the function will quit at that point.

The infinite loop might be coming from what you have calling this function elsewhere, also…

1 Like

Thx

1 Like

there is also a max loop count in settings which you could be exceeding.

Project Settings → Engine → General Settings → Max Loop Iteration Count.