I nedd some help with drag in line

i want a simbol to be dragd by the user exaclly in line (straight or twisting), like following the unshowed line… (and not moving freely)
can i do that?
how?

thank!