How to Detect a part is touching to terrain water?

I am trying to make a shovel system. But there is a problem about digging. I don’t want that player is able to dig water so I tried to use some RayCast scripts but now it says Air when I print material. I am not sure why. (The script below is not made by me.)

local ray = Ray.new(Part.Position,Part.CFrame:VectorToWorldSpace(Vector3.new(0,-3,0))) 
	local hit,position,normal,material = workspace:FindPartOnRay(ray,Part)
2 Likes

You should consider using the newer and supported WorldRoot:Raycast where you can retrieve a raycast result’s terrain or object with greater ease and accuracy, as well as completely ignore terrain water.