title: Vector3.Lerp with code in Unity
body: <p>I'm making a basic 2D space shooter game in unity. I have the movements working fine and the camera follows the player. I've been scratching my head over how to give the camera a slight delay from the player moving to the camera moving to catch up to it without it teleporting. I was told to use a Vector3.Lerp and tried a few things from stackoverflow answers but none seemed to work with the way my code is set up. Any suggestions?
  (myTarget is linked to the player)</p>
  
  <pre><code>public class cameraFollower : MonoBehaviour {
  public Transform myTarget;
  
  
  void Update () {
      if(myTarget != null){
          Vector3 targPos = myTarget.position;
          targPos.z = transform.position.z;
          transform.position = targPos;
  
          }
  
      }
  }
  </code></pre>