How do I delete a region3/what happens if you spawn mutiple regions ingame more indepth explanation in description

So im making an animal game called Animal Kingdom Survival Simulator which obviously includes Herbivores and I’ve scripted so that whenever a player stand near terrain grass and clicks on its mouse that isn’t clicking anywhere else then the player does an eating animation and the grass terrain is turned into dirt terrain using a region of an area near the players mouth So I’m wondering what happens to the region does its disappear I’m worried if multiply players are eating grass spawning useless regions then this will break the game link to vid cause roblox wont let me upload eating grass future roblox game - YouTube

I wouldn’t recommend using region3s as you can’t set parameters, and I’m not 100% sure but they might be deprecated.

Instead I would use some code like this:

for i, v in pairs(workspace:GetPartBoundsInBox(CFrameOrigin, Vector3Size, OverlapParams)) do
-- i would be the number in the list
-- v would be the part itself
-- ex. code
v.Material = Enum.Material.Slate
end

This allows for highly more accurate boxes as you can rotate them, only look for parts in specific folders/models, or exclude specific parts in folders/models.

I dont really understand the script Im not trying to create new terrain I’m trying to paint existing terrain in the game like the video shows but thank you

region3’s are deprecated and you should use OverlapParams instead

1 Like

I found the solution How would I remove an existing Region3 TLDR region is like a raycasting its just data its will be cleaned out by roblox once its no longer referenced