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.