Unwanted behavior of Terrain:PasteRegion()

Hello! I have lately came to a point where I have to create my own round/map loading system.
After reading roblox documentation, I was happy to find that I can load maps with terrains easily on-the-go by using Terrain:PasteRegion().

To be clear - the method itself works as intended, it indeed pastes terrain voxels in the desired Region3, but there’s a catch - it clears all other terrain.
This normally wouldn’t be an issue, but I have a lobby that also has terrain in it, and I would like said terrain to stay so players joining mid-round will not be falling into the void until the round is over.

How do I paste terrain without deleting any other terrain?
I have tried using terrain load plugins, but that failed because their source codes/API’s are based on Terrain:PasteRegion().
I also tried to read voxels of terrain and write them later, but I was unpleasantly suprised when I found out that trying to read terrain in 3200 x 200 x 1800 studs region3 freezes my computer, so that’s also not the way.

Is there any alternative way or do I have to separate my map sets into tiny bits and read/write each bit’s voxels individually?

Thanks in advance. :slight_smile:

Terrain:PasteRegion has a third argument called pasteEmptyCells which I believe you want to set to true.

1 Like

My bad I didn’t check that I always had this parameter set to “true”:
PasteEmptyCells should be set to false to avoid overriding all the terrain.

PasteEmptyCells set true makes it replace existing terrain with air (most likely, what’s important is that it deletes everything else).

Thank you sir for your assistance. :sparkling_heart:

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