Help with optimizing lag

So I’ve been making a minecraft recreation. My major issue is the lag. When the game generates the world, it starts heavily lagging. I’ve tried putting wait() in the generation loop, but it’s still the same. I appreciate any help from you guys, thank you.

Edit 1 : I also need help with making a system that makes blocks disappear when you’re at a certain distance away.

3 Likes

I can’t fully answer your question or give many in-depth examples, but I can give a few pointers.

To speed up world generation, try multithreading with Parallel Luau; this is one of the few cases where setting up a multithreaded system is actually worth it.
Here’s an excellent video tutorial: https://www.youtube.com/watch?v=BbIPalpAfaI

And to answer your second question, play around with Content Streaming.
Video tutorial: https://www.youtube.com/watch?v=d8pqcfxqmek

Thank you so much even though i don’t know what multithreading is

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.