ForEachLoop causes infinite loop error

This is a textbook infinite recursion issue.

In the BeginPlay of WallBP, you’re spawning more WallBPs, which calls BeginPlay on those, which spawns more WallBPs, which calls BeginPlay on those, etc…

What are you trying to achieve?

Hello, I am new to UE4, so dont expect me to know much. However, i tried to create a dynamic room, so i tried to spawn walls, their location stored in an Array. Following unexpected error occured while testing:

BP:

I hope you can help me since i dont know the actual problem.

Is your location array empty? Maybe if it is, then it would be a 0 loop…

Would me my suggestion

thank you, that makes sense. I try to to create a room, which i can modify while running the game. the wall is just one actor to start with, also, i want the Array to be filled through another algorithm, this here was just to try the spawning.

Logically a different actor should be in charge of spawning more walls, not the wall class itself.