Line Trace to create mesh

Is it possible, and how would I make it so that the line trace finds the distance between character and object and create a mesh to fill the distance?

So you can create for example a cylinder from player to wall, and the length of the cylinder depends on the distance to the wall?

If you find an answer please post. I would like to know how to create a mesh from a line as well.