Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you clear a specific region of the terrain?

Imagine that clearing the terrain region will leave behind a cube shaped hole, is it possible?

And btw, is it also possible to specify the materials inside the region? And deleting those materials only too?

I hope you understand, ask me if you don't.

1 answer

✓ Accepted answer

https://developer.roblox.com/api-reference/function/Terrain

workspace.Terrain:FillRegion(Region3, resolution, 1792)

Region3 would be the region you want to change, resolution would be how smooth you want it, and 1792 is the material code for air

I'm not going to write it out for you anymore after this because you should have attempted it before coming here.

If this gets you going in the right direction, then please mark this as the accepted answer.

3 comments

0

Thanks for the answer, but can you also answer the rest of the questions?

0

@anphu04 you can get the terrain material ID codes from this link: https://developer.roblox.com/api-reference/enum/Material

0

As for clearing terrain of only a specific material, I am not sure because I don't have access to the studio right now, but https://developer.roblox.com/api-reference/class/Terrain is where you can find all the functions you can use. I am actually interested in that part of your question, so if you find a solution, let me know.

This discussion is preserved as it was. New answers, comments, and votes are closed.