Terrain will not change to air due to Region3 size

I know the script works and it works fairly well with no performance issues or anything, but the only thing is it doesn’t dig into the side of terrain! It just flat out doesn’t work sometimes.
Visible Region3
As you can see the actual script does work, but the size of the region is the problem. Is there any way I could remedy this?

2 Likes

Wondering, Have you tried making the region bigger?

I have and that does work, however I would like it not to have to change size.

Instead I have just make it move forward from the mouse’s lookvector, but I’m still curious if there’s a better way

Are you using the Region3:ExpandToGrid method?

You may also need something more complicated, like setting all the voxels actually within the box to 0 occupancy but maybe setting partially-covered voxels to some % occupancy?

2 Likes

I have not though of using ExpandToGrid or the voxels; those probably work a lot better than what I’m doing right now

As said above, you should expand the region3 to the grid. Another solution would be to use FillBlock instead of FillRegion. I found it to work much better if you ever decide to make smaller 3D brushes. FillRegion will basically nuke all the voxels in its range. FillBlock, FillWedge and FillBall will give much smoother edges.

3 Likes

I’m using ReplaceMaterial instead of FillBlock cause I don’t want them to be able to build into rock and this seems like the easiest option

Not really sure where Region3 comes in as a solution. If you’re saying that you’re using Region3 so that you can create a limit to how deep you want it to go, you could just use FillBlock with the Region3’s properties.

Terrain:FillBlock(region.CFrame, region.Size, Enum.Material.Air)

sorry that was at night I meant ReplaceMaterial lol

1 Like

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