title: Lerp the alpha value of a color
body: <p>I want to change the alpha value (transparency) of a color back and forth:</p>
  
  <pre><code>private void Awake()
  {
      material =  gameObject.GetComponent&lt;Renderer&gt;().material;   
      oColor   = material.color; // the alpha here is 0
      nColor   = material.color;
      nColor.a = 255f;
  }
  private void Update()
  {
      material.color = Color.Lerp(oColor, nColor, Mathf.PingPong(Time.time, 1));
  }
  </code></pre>
  
  <p>This doesn't work, the color instantly changes to white, and it keeps blinking the original color. I'm following <a href="https://docs.unity3d.com/ScriptReference/Color.Lerp.html" rel="nofollow noreferrer">this</a>.</p>