Terrain:FillRegion Error

Im using the Roblox Studio command bar to generate a flat plain of terrain instead of placing it all by hand to make it easier and I run into an error stating:
“Region Cannot be Empty”

Code:

game.Workspace.Terrain:FillRegion(Region3.new(Vector3.new(-8730.5, 0.5, 1523.25), Vector3.new(2267.665, 0.5, -2987.38)):ExpandToGrid(4), 4,Enum.Material.Grass)

It’s obviously a region error but I have no idea what the error is, I can change the vector3 values as much as I want and no outcome prevails.

Keep in mind im using the studio command bar so I can save the outcome and publish it to roblox later.

2 Likes

Your region doesn’t make sense, make sure you’re using two diagonal points. It needs to be a box :eyes:

Your Y axes are both the same. That’s not a region, that’s a line.

The first vector’s values need to be lower than the second. Simply switch the Z axes and it should fix it.

game.Workspace.Terrain:FillRegion(Region3.new(Vector3.new(-8730.5, 0.5, -2987.38), Vector3.new(2267.665, 0.5, 1523.25)):ExpandToGrid(4), 4,Enum.Material.Grass)

edit: like @Kampfkarren said, the Y axis can’t be the same either

2 Likes

Technically it’s a plane :eyes: :airplane:

2 Likes