Distance to nearest Surface Not working on 2D Planes

Hi

I cant get the ‘DistanceToNearestSurface’ node to work on overlapping 2d objects like a plane.

I want it to work on coastal rocks who’s roughness would change when a water shader plane overlaps it.

Can anyone help me?