i have a game that is constantly loading in and clearing large maps of terrain. loading terrain is not an issue, as I have split the terrain in 2 and load it in separate times. for clearing, i would always use workspace.Terrain:Clear(). unfortunately, on some sizes of the terrain that is not a viable option, as it causes a complete crash to the script, causing an script exhaust/timeout. is there any safe way to clear this terrain without overloading the script?
#how to clear large map terrain without causing script exhaust
1 messages · Page 1 of 1 (latest)
** You are now Level 1! **
You may want to consider clearing the terrain in smaller chunks or sections, instead of all at once, and allowing the script to yield or wait in between each section. This way you can reduce the amount of memory and computation that is needed for each clear operation, and prevent a complete crash of the script. Additionally, you can implement a progress bar to show the user how much of the terrain has been cleared and prevent them from assuming the game has frozen.
can you explain in more detail on how to do that?
i think you mean using coroutine.yield() right?