Replacing a part with terrain

Hey all!
I’ve been stuck on a thing I’ve been trying to make for a few hours now, and couldn’t find any solution, or any form of resource that could help me figure out how to do it. I’ve tried alternatives, such as Terrain:FillBall(), however that doesn’t account for spheres, so here I am!

image
Let’s say you want to make an explosion have a crater, great!
Obviously, it has the hole, but it also throws some debris in front of it, which is meant to be created! Which is exactly what I’m stuck with.
Thank you in advance!

1 Like

So you would like to “Negate” the space filled by the red ball?

1 Like

Yes, but not exactly! I need to first create the impact terrain with the green sphere, and then ‘negate’ the remaining terrain with the red ball.

I really don’t know how you would do Terrain for the green part. I suggest at first to download the part to terrain plugin and try to replace the green part using the plugin. If it doesn’t work then it’s impossible. For the red part, you could use Terrain:FillBall() with the necessary arguments.

You can use the property:

FillBlock() or FillBall()

Here is a brief summary of its properties;
Let’s imagine you have a “Part” named “Part” in Workspace

Added land to an area:

workspace.Terrain:FillBlock(workspace.Part.CFrame, workspace.Part.Size, Enum.Material.Glass) -- Material Enum.Material.Glass

Removing this land within this area:

workspace.Terrain:FillBlock(workspace.Part.CFrame, workspace.Part.Size, Enum.Material.Air) -- Material Enum.Material.Air

I am aware of both of those, and I am using FillBall() property for the symmetric ball, however, I am unable to use it in order to get a sphere shape.

You can try:
Place a sphere in your Workspace with the name “Ball”

To add:

local Radius = 10
workspace.Terrain:FillBall(workspace.Ball.Position, Radius, Enum.Material.Glass)

To remove:

local Radius = 10
workspace.Terrain:FillBall(workspace.Ball.Position, Radius, Enum.Material.Air)

Well I have an idea. Why don’t you create a bigger sphere and place it a bit in the ground and then take the smaller sphere (red ball) and negate it.

1 Like

The second sphere is not symmetrical, its height is different value compared to other dimensions

That actually does the trick, thank you!

1 Like

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