Line2D following mouse/finger in specific path

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dancaer69

I created a new thread because is a different question but there are more info about in this question:
https://forum.godotengine.org/94718/implement-a-kind-of-drag-and-move-action

Right now I have a line which following mouse and is a child of an empty label, so to draw only inside label’s rect.
The hierarchy is like this:
-Board
–Backgound
–Letter1
–Letter2

–Letter7
–Label
—Line2D

The code for the line draw is _proccess in Board.gd script and the Letters are inherited scenes of a base Letter scene.

func _process(delta):
if WordUtils.dragging==true:
	for i in letternodes:
		if i.get_child(2).text !="":
			$Line/Line2D.add_point(get_global_mouse_position())
			#$Line/Line2D.add_point($Line/Line2D.to_local(i.get_child(0).to_global(position)))
			while $Line/Line2D.get_point_count() > trail_length:
				$Line/Line2D.remove_point(0)
else:
	$Line/Line2D.clear_points()

With the above the line draws everywhere inside the label’s rect, after I press and hold mouse left button and start dragging.
This is fine, but I’ d like to have drawing in a specific path from letter to letter and also to clear the line points in reverse direction moving following that path.
If I uncomment the line:

$Line/Line2D.add_point($Line/Line2D.to_local(i.get_child(0).to_global(position)))

and use this to draw the line this creates a polygon between letters centers(which is the correct path), but draws at once when I press mouse button.
So this is the correct path but I don’t know how to draw this polygon gradually as dragging with the mouse left button pressed. And also to keep track of the path and clear the points as dragging in reverse direction.
To be more clear, when dragging from letter to letter I append the characters in a label every time the mouse enters a letter’s area. So in reverse movement I want to remove the letter’s character in order. Some kind of undo action.
Any ideas?