Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you clear a specific region of the terrain?

Asked by 6 years ago

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

Log in to vote
2
Answered by
SteamG00B 1633 Moderation Voter
6 years ago
Edited 6 years ago

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.

0
Thanks for the answer, but can you also answer the rest of the questions? Konethorix 197 — 6y
0
@anphu04 you can get the terrain material ID codes from this link: https://developer.roblox.com/api-reference/enum/Material SteamG00B 1633 — 6y
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. SteamG00B 1633 — 6y
Ad

Answer this question