I’ve made a procedural generation chunk thingy but I had to remove the chunks far away from players to save my PC from exploding
yay it worked but I saved the chunks to a table, and I don’t know where else to put the chunks
what do I do to make it optimized?
script: ( very shortened )
local ChunkController = require(script.ChunkController)
local Chunks = {}
while task.wait(5) do
ChunkController.RemoveOutOfRange()
local NewChunks = ChunkController.Generate(Chunks)
for i, Chunk in pairs(NewChunks) do
table.insert(Chunks, {
["Name"] = Chunk.Name,
["Pivot"] = Chunk:GetPivot()
})
end
end