Extents cannot be empty

Hello everyone! I’m trying to build a part road with smooth terrain, and to make things easier I’m trying to use a simple code that should help me on that. But for some reason this error appears, and I got no idea on how to fix it.

CODE:

for i,v in pairs(workspace:GetChildren()) do if v.Name == “ROAD” then workspace.Terrain:FillBlock(v.CFrame+Vector3.new(0,50,0),v.Size+Vector3.new(0,100,0),Enum.Material.Air) workspace.Terrain:FillBlock(v.CFrame+Vector3.new(0,-1.5,0),v.Size+Vector3.new(15,-2,5),Enum.Material.Asphalt) end end

Can we see what the error is??

Edit: It’s the title isn’t it?

2 Likes

make sure your size parameter is not negative, try printing your Y value as I think your -2 might be too much.

for i,v in pairs(workspace:GetChildren()) do
    if v.Name == "ROAD" then 
        print(v.Size.Y - 2, "if this is negative or zero we have a problem!")
    end
end
1 Like

Yes, that’s the error. You are goddamn right.

1 Like

I was confused at first, but now I got it. My terrain height was 2 studs, which caused the error. Thank you so much for the help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.