First you can use line as 3D line with 6 parameters xyz and xyz
See Random walker through points - #15 by Chrisir