You are going to have to determine the path from point to point and fill it in.
I am with gertkeno and say that adding children for this is not a great way to go about it.
Even a small line is going to add hundreds of child nodes to the tree.
I would look at the various draw functions available to CanvasItem derived nodes like Control or Node2D. Here is a tutorial for something similar using GODOT 3.x
thanks for comment.
I’m sorry, I forgot to mention this.
I want to make the drawn lines into rigidbodies, but is it possible to do that with drawing using CanvasItem?
I was trying to create a drawing with Line2D. However, I realized that it’s not possible to draw a simple circle with Line2D.