so i intend to create a perlin noise terrain generator. i've never worked with terrain before, but i was looking around on the wiki and discovered :FillRegion() function for terrain, which takes 3 arguments:
:FillRegion(Region3 region, float resolution, Material material
well, that's all fine and dandy. i understand that Region3 takes two arguments, the first one being a minimum Vector3 value defining one corner of the region and a maximum defining the opposite corner.
resolution confuses me a little bit, but i set it to 4 because the output complained and said that the resolution had to be 4.
material is straightfoward enough
the problem is the error you saw in the title, Region has to be aligned to the grid (use Region3:ExpandToGrid). i've got no clue how im supposed to use Region3:ExpandToGrid or why i need to use it.
here's my code btw:
sea_level = .5
origin = 0
size = 1200
region = Vector3.new(origin-size,sea_level-12,origin-size),Vector3.new(origin+size,sea_level,origin+size)
--terrain generation
local terrain = workspace.Terrain
workspace.Terrain:FillRegion(Region3.new(region),Region3:ExpandToGrid(4),Enum.Material.Water)
so pretty straightforward, i don't understand how im supposed to use region3:ExpandToGrid. any ideas?
hope i explained my situation well enough. :^)

1 comment
ty, that worked; i defined the original region as reg and then defined region as reg:ExpandToGrid(4), that resolved my issue. i appreciate it :^)