I've been dabbling in some region 3 stuff this morning, and I ran across an issue with the following code:
local module = {}
function module:Explode(pos, size)
local region = Region3.new(pos, size)
local partsInRegion = workspace:FindPartsInRegion3(region)
for i, part in pairs(partsInRegion) do
AddVelocity(part)
end
local expandedRegion = region:ExpandToGrid(4)
workspace.Terrain:ReplaceMaterial(expandedRegion, 4, Enum.Material.Air, Enum.Material.Ground)
end
return module
Note: this is in a ModuleScript, and the function AddVelocity is hidden.
The error says says Region cannot be empty. If you would like to know the pos and size values, pos is generated by a script, and size is Vector3.new(8,8,8). The pos can be anywhere between -448 and 448 on the x and z axis, and -20 on the y axis.
