Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Detecting when a part has collided with water?

Asked by 8 years ago

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

Log in to vote
0
Answered by
jtp40 7
8 years ago

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.

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. User#11440 120 — 8y
0
I know you can do that, but that would also kill the player when he/she touches it. The_Sink 77 — 8y
0
wfvj, oops put in putoutfire because I had that function in another script and was thinking about it during writing it jtp40 7 — 8y
Ad

Answer this question