Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Detecting when a part has collided with water?

Ive looked and found no way of doing this. Is there a way that you can make a script detect if a a any parts in a model (Not a user, something like a prop) has collided with water? I want to make it so it breaks on contact with the water. And by the way, I am talking about Terrain water, not some blue, translucent brick.

1 answer

Terrain water doesn't have a name or really, any way to identify itself. It can not be detected by script. You can put invisible non-cancollide anchored parts called water parts over water. In this instance, lets say the part is called waterPart.

function WaterBreak(part)
--Put in whatever you want to break the parts here
end
waterPart = game.Workspace.WaterPart
waterPart.Touched:connect(WaterBreak)

This is a script to find out when you touch the water part.

3 comments

0

I mean, you're calling a function that doesn't exist, but other than that, I agree. I couldn't find a way to detect if a part touches water.

0

I know you can do that, but that would also kill the player when he/she touches it.

0

wfvj, oops put in putoutfire because I had that function in another script and was thinking about it during writing it

This discussion is preserved as it was. New answers, comments, and votes are closed.