Deleting water block?

I’m trying to make a stage that temporarily spawns water. It works, but I’m having trouble deleting it from the map when I change stages.

local waterBlock = game.Workspace.Water;
game.Workspace.Terrain:FillBlock(waterBlock.CFrame, waterBlock.Size, Enum.Material.Water);
waterBlock:remove();

WaterBlock is just a part, it’s not the actual water. Try instead, modifying the material from water to air this way instead of using remove:

to:
workspace.Terrain:FillBlock(waterBlock.CFrame,waterBlock.Size,Enum.Material.Air)

1 Like

WaterBlock isn’t a BasePart instance, it’s part of the Terrain, but yes your solution of changing the material type of the Terrain block from water to air is the correct approach.

No, in this scenario by waterBlock, we are referring to a part in the workspace, used to generate the water.

Therefore, waterBlock is just a part, not the actual water, so removing it won’t do anything.
Instead we reuse it to swap water for Air!

Let me know if it’s clearer this way :stuck_out_tongue:

Oh my bad, you were referring to the BasePart instance which is being filled not the Terrain block itself.