Ants are shuttering, because your algorithm is wrong. Ants detect water, stop, get wet, find new path, start moving, you set wet=0, they detect the same tile with water again, stop.... And this happening many times a second.
You can try "On collision with water" instead.
Also, why do you use Terrain array? The tilemap itself is like an array, and there are expressions to convert layout coordinates to tilemap coordinates and vice versa. So I think the array is just making things more complicated.