I've been trying to draw a similiar lines on the screen show above for debuging purposes.

i tried using line3D plugin but plugin wasnt working for some reason (here is the plugin link ). So i tried using line2D as a child in UI nodes and managed to draw a line. But i cant move the second point of the line2D to the object i want it to follow.
This is what ive achieved so far

And this is what i want it to do

i have no idea how to achieve this, can anyone help me out?
sorry for the bad english