Draw straight line between touch points

First of all, I’ve read up on drawing lines using touch but haven’t found a specific solution yet.

I’m new to Unity and trying to create a scenario where player will touch a point A anywhere on the screen, drag finger to point B then release so that a straight line/rectangle with collider is drawn between the two points A and B.

Sort of how the Line tool of Illustrator works in this GIF. Point B should follow the finger as it drags while the point A is fixed and acts like pivot.

How would I do this?

Thanks.

I’ve answered a few similar questions. Here is one link:

http://answers.unity3d.com/questions/599761/how-can-i-draw-a-line-in-unity-with-mouse-.html

Try it out in a new scene using a cylinder as specified first. To draw a rectangle instead, use a Quad and set ObjectHeight to 1.0.

You will have to convert from mouse to touch.