Trying to create a function that will copy and paste terrain inside of a part. But i have no experience in using Int16 values. I’ve edited the code provided on the DevHub about copying and pasting terrain but I just cant get it to work.
The Centres of the Region3 and the TerrainRegion are different if thats a clue?
I also cannot find any other posts about this. Can someone please help?
local part = game.Workspace.Part
local min = part.Position - (0.5 * part.Size)
local max = part.Position + (0.5 * part.Size)
local Regions = Region3int16.new(Vector3int16.new(min.X, min.Y, min.Z), Vector3int16.new(max.X, max.Y, max.Z))
local terrainRegion = workspace.Terrain:CopyRegion(Regions)
workspace.Terrain:Clear()
part:Destroy()
wait(5)
workspace.Terrain:PasteRegion(terrainRegion, Regions.Min, false)
Not sure if this will help you because I’m not entirely sure what you’re using this script for, but I was creating a murder mystery style game and wanted multiple terrain regions for each map (all different of course) and instead of doing complex copying and pasting of region data, I used this plugin to just load terrain region instances.
Again, not sure if it’ll actually help because I don’t know why you’re loading terrain/for what purpose, but the source code of that plugin helped me. (You can find source codes in your Roblox program files after downloading the plugin)