if firstSegmentPosition.x < -3200 then
go.delete_all(segments[1])
table.remove(segments, 1)
end
result was the same
WARNING:GAMEOBJECT: go.delete_all(): instance could not be resolved
WARNING:GAMEOBJECT: go.delete_all(): instance could not be resolved
WARNING:GAMEOBJECT: go.delete_all(): instance could not be resolved
WARNING:GAMEOBJECT: go.delete_all(): instance could not be resolved
WARNING:GAMEOBJECT: go.delete_all(): instance could not be resolved
DEBUG:SCRIPT: deleting segment
Okay You know, I’ve been making games in Unity (writing in C#), and after trying Lua today, googling for manual on official website, I concluded, that C# is a lot easier
You get a list of all spawned game objects from collectionfactory.create(). Any objects you delete before calling go.delete_all() should be removed from that list. One way to do it is to have each game object send a message back to the spawner script when it is deleted so the spawner script can manage the bookkeeping.