title: Moving a camera from it's current position to a specific position smoothly in unity?
body: <p>I  have a camera that is orbited, panned around an object to showcase the object in question, because the object is rather large it's easy to potentially lose your position and want to get back to the starting position, I'd like to do this via a button.</p>
  
  <p>I'd also like this transition to not be jarring, a smooth transition between it's current position and the one specified. I realise this is an interp related question and I've no idea where to start with this.</p>
  
  <p>My basic transform code so far is</p>
  
  <pre><code>public Camera MainCamera;
  
  public void UserClickedCameraResetButton()
  {
      MainCamera.transform.position = new Vector3(106, 68, 15);
      MainCamera.transform.rotation = new Vector4(40, 145, 0);
  }
  </code></pre>
  
  <p>As usual many thanks</p>
  
  <p>UPDATED WITH CODE THAT SOLVED MY PROBLEM.</p>
  
  <pre><code>public Camera MainCamera;
  public GameObject TargetPosition;
  public int speed = 2;
  bool camera_move_enabled = false;
  
  void Update()
  {
  
      if (camera_move_enabled)
      {
          MainCamera.transform.position = Vector3.Lerp(transform.position, TargetPosition.transform.position, speed * Time.deltaTime);
          MainCamera.transform.rotation = Quaternion.Lerp(transform.rotation, TargetPosition.transform.rotation, speed * Time.deltaTime);
      }
  
  }
  
  public void UserClickedCameraResetButton()
  {
      TargetPosition.transform.position = new Vector3(-106.2617f, 68.81419f, 14.92558f);
      TargetPosition.transform.rotation = Quaternion.Euler(39.7415f, 145.0724f, 0);
      camera_move_enabled = true;
  }
  </code></pre>