Deleting factory children once they go offscreen

I am trying to delete any instances of a game object produced by a factory once they reach a certain position off-screen. I have the ids of the game objects stored in a table but was wondering how i iterate through the table and pass each id through the go.delete() function.

Help is much appreciated !!

Something like this?

t = {}
...
for k,v in pairs(t)
    go.delete(v)
end
2 Likes

That works perfectly.

Thanks !

1 Like