How to draw a line with touch?
<p>I am trying to draw a line with LineRenderer that follows the user's finger movements. So far I have been unable to draw a line. 
This is the code i got.</p>

<p>how do i do it?</p>

<pre><code> var c1 : Color = Color.white;
 var c2 : Color = Color.white;

 var line : GameObject;

 var lengthOfLineRenderer : int = 5;

 function Update () {

var touchCount : int = 0;

if (Input.GetMouseButtonDown (0)) {

touchCount++;

}

if (Input.touchCount == 1) {

if (Input.GetTouch(0).phase == TouchPhase.Moved) {

  var lineRenderer : LineRenderer = line.AddComponent(LineRenderer);
  lineRenderer.SetColors(c1, c2);
  lineRenderer.SetWidth(0.2,0.2);
  lineRenderer.SetVertexCount(lengthOfLineRenderer);
  lineRenderer.SetPosition(0, gameObject.transform.position);

 }

 }   

 }
</code></pre>