dngbae2
(dngbae2)
January 15, 2022, 10:30pm
#1
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();
Daronion
(Daronion)
January 15, 2022, 10:33pm
#2
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:
dngbae2:
waterBlock:remove();
to:
workspace.Terrain:FillBlock(waterBlock.CFrame,waterBlock.Size,Enum.Material.Air)
1 Like
Forummer
(Forummer)
January 15, 2022, 11:23pm
#3
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.
Daronion
(Daronion)
January 15, 2022, 11:52pm
#4
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
Forummer
(Forummer)
January 15, 2022, 11:53pm
#5
Oh my bad, you were referring to the BasePart instance which is being filled not the Terrain block itself.