title: How to get all points positions of line renderer in unity?
body: <p>I want to get all points positions in the line of line renderer ,i need this points positions because i want to draw a line by line renderer and then let a ball move on this line so i want to move this ball using line's points position to let the ball move on this line after drawing it</p>
  
  <p>and this is my code to draw a line using line renderer</p>
  
  <pre><code>public LineRenderer lineRend;
  public EdgeCollider2D edgeColl;
  
  List &lt;Vector2&gt; points;
  
  public void Update_line(Vector2 mouse_pos)
  {
      if (points == null)
      {
          points = new List&lt;Vector2&gt; ();
  
          set_point(mouse_pos);
  
          return;
      }
  
      if (Vector2.Distance(points[points.Count - 1], mouse_pos) &gt; .1f)
      {
          set_point(mouse_pos);
      }
  
  }
  
  void set_point(Vector2 point)
  {
      points.Add(point);
  
      lineRend.positionCount = points.Count;
      lineRend.SetPosition(points.Count - 1, point);
  
      if (points.Count &gt; 1)
      {
          edgeColl.points = points.ToArray();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And the below image illustrates what i want to do in my game 
  the ball which is in the bottom of the image i want it to move on the drawn line </p>
  
  <p><a href="https://i.stack.imgur.com/psRAk.png" rel="nofollow noreferrer">The illustration image</a></p>
  
  <p>so what i have to do this by code ?</p>