Hi everyone,
I’m having a problem with in-built PasteRegion()
function. I use it to load a smooth terrain for the next round. The issue is when it’s about to load the entire main script just crahes, very frequently, almost 30% of the time. It happens due to a script timeout. It seems that PasteRegion()
takes too much time to execute.
terrain:PasteRegion(curMapPath.SavedTerrain, Vector3int16.new(-32000, -32000, -32000), false)
error message:
Script timeout: exhausted allowed execution time
What I want to achieve? I’d love any help to figure out a way to possibly disable / lengthen default timeout time or tell the script to yield when the function is happening or how can I deal with that differently? Unfortunately I can’t edit the PasteRegion() itself.
I’ve tried putting it into coroutine, spawn, pcall. I’ve tried adding wait(10) before and after the function, and also I’ve tried retrying the function when it gets timed out, but the thread is getting killed even in pcall()
I appreciate any help, it’s urgent.