you'll need the collide and the get y at x block for this it seems to have some trouble with the edge of the line
the get y at x block was made by @sbissay, the rest is by me