Infinite loop error

grab that list of actors to spawn and save in a variable in the class. (toSpawn)

have a variable for how many actors to spawn per frame.

have a function that spawns actors (SpawnActors)

inside you loop the toSpawn array, from the last point until last+howManyPerFrame.

you spawn.

update last.

set a timer for next frame to the same SpawnActors functions.

if last >= total then return without setting a timer.

1 Like