Moving meshes into scene laggy

i have a procedural terrain generator that includes roblox’s terrain and meshes like trees and rocks

i cache all of the entities by putting them into a folder and out of view and they never leave workspace

for some reason it still lags when pulling the objects that already exist in the workspace back into scene

1 Like

The lag most likely comes from the terrain rapidly loading/deloading

2 Likes

Three Things:

Are you utilizing WorldModel:BulkMoveTo?

Are you caching and reusing your models? As in, are you setting unloaded meshes somewhere far away from the renderer and then setting them to back when a new chunk loads? (This may be helpful)

Is there any Parallel LuaU involved? Splitting terrain generation to different cores can shorten the computation time per frame.

Very likely the terrain loading. You may need to send us the code so we can review what could be causing this issue.

i am caching all the items by renaming them and putting them into the sky. i heard somebody talk about reparenting them to a cache folder is laggier than just simply renaming them.

also idk how to use bulkmoveto i’m just using pivotto and new to parallel lua

it uses 2d noise every 1 stud in a chunk to calculate height, other than that the only other perlin used is the rock fields and some areas having larger rock groups than others. so i would say 3-4 math.noise per stud in a chunk

i’ve noticed when i generate only terrain that my fps almost doubles up to 40-50 fps