title: Unity3d Linerenderer not visible
body: <p>I am trying to draw a line between two UI GameObjects with Linerenderer. In scene mode everything work fine, but in game mode line is invisible. I tried to change Z position of objects but lines are still invisible. Can anyone help me? Thanks in advance</p>
  
  <pre><code>private LineRenderer lineRenderer;
  private float counter;
  private float dist;
  private Vector3 aPos;
  private Vector3 bPos;
  public Transform origin;
  public Transform destination;
  public float lineDrawSpeed = 6f;
  
  // Use this for initialization
  void Start()
  {
      lineRenderer = GetComponent&lt;LineRenderer&gt;();
      aPos = new Vector3(origin.position.x, origin.position.y, origin.position.z); // Using these to move the lines back
      bPos = new Vector3(destination.position.x, destination.position.y, destination.position.z);
  
      lineRenderer.SetPosition(0, aPos);
      lineRenderer.SetWidth(3f, 3f);
  
      dist = Vector3.Distance(origin.position, destination.position);
  }
  
  // Update is called once per frame
  void Update()
  {
  
      if (counter &lt; dist)
      {
          counter += .1f / lineDrawSpeed;
  
          float x = Mathf.Lerp(0, dist, counter);
  
          Vector3 pointA = aPos;
          Vector3 pointB = bPos;
  
          Vector3 pointAloneLine = x * Vector3.Normalize(pointB - pointA) + pointA;
  
          lineRenderer.SetPosition(1, pointAloneLine);
      }
  
  }
  </code></pre>