Unable to copy terrain region and successfully paste it

I’m currently trying to copy terrain in a region defined by two parts, “Part1” and “Part2.”

Part1 position: -102, -260, 102
Part2 position: 102, 180, -102

I’m having trouble getting the TerrainRegion from these two coordinates. Here’s my command approach that always results in a studio crash.

local terrainRegion = workspace.Terrain:CopyRegion(Region3int16.new(Vector3int16.new(workspace.Part1.Position.X/4, workspace.Part1.Position.Y/4, workspace.Part1.Position.Z/4), Vector3int16.new(workspace.Part2.Position.X/4, workspace.Part2.Position.Y/4, workspace.Part2.Position.Z/4))); terrainRegion.Parent = workspace

Why is this crash occuring? I assume its because the Vector3int16’s are constructed with decimal values (because the position values are divided by 4). No matter how many math.round shenanigans I try, this always ends up with a crash.

I searched the related developer hub pages far and wide but I can’t figure out a solution

So, how would I get a TerrainRegion object from two position points? Happy to provide more info where necessary.

I’m not sure but why are you using Vector3int16.new() ?

From what I read on the developer hub, Terrain:CopyRegion() requires a Region3int16, and a Region3int16 requires two Vector3int16’s.


I’m pretty sure to paste the region you need to use terrain:Paste() or smthg like that.

I understand how to paste a region but I am unable to get the TerrainRegion because the command is crashing on me. More details in the OP