Raycast achieved!
It took a few hours, but I made it! I have a Raycast that goes from the camera, follows the mouse cursor, and intersect with the XZ plane.
The struggle came from the fact that it was very hard to find a tutorial. Most of the resources I found were actually step by step with no explanation, and I would rather understand what's going on than blindly copy paste pieces of code. On top of that, Godot have changed the code recently. Now instead of having a raycast function full of parameters, you have to build a RaycastQuery object that gets all the parameters, and use that as the only argmuent in the raycast function.
Godot has also introduced the Raycast3D node, which is supposed to simplify the whole process by not having to redo the whole query in lines of code, which is pretty neat!...
Or it would be, if it worked. Using the Raycast3D Node gave me a weird offset in the result, it was very frustrating.
In the end I had to patch together 4 bits of code from the official documentation, and now it works. Yay!
I chose to intersect with the XZ plane rather than the ground because I want the freedom of having an uneven ground (for aesthetic reasons) but the pipes and alembics will stay all at the same height so I don't have to deal with matching the IN and OUT of the pipes. And I think it cost less to intersect with a single plane rather than hundreds of blocs?