How to draw a line where a mouse was

im making a game that draws line that follows the mouse cursor and then a actor to follow that line and navigate through the map

I’ve tryed splines and they wont work what ever i throw at it ive tryed the draw line command and they just dont work because they dont accept floats and variables