Smooth Camera Follow

I done a simple code of a Camera Follow to a 2D Platformer, but i want to add a little delay on the follow, how can I do this ? It’s possible on my code ?

using UnityEngine;
using System.Collections;

public class CameraScript : MonoBehaviour 
{
	public Camera mainCamera;
	public GameObject player;
	
	
	
	void Update () 
	{
		mainCamera.transform.position = new Vector3(player.transform.position.x, player.transform.position.y,transform.position.z);
	}
}

One possibility is to make a (camera tracking) gameobject which will follow the player if the distance between the player and the game object is greater than a certain amount. When this amount is exceeded, get the object to follow the player until it catches up.
Then, instead of getting the camera to follow the player, get it to follow this gameobject.

You could gradually increase the speed at which this gameobject moves to allow it to catch up, then reset it when it catches up.

I’ve never actually done this, so it’s hard to say how well the implementation would work.

iTween has lots of utilities for smoothing movement.

http://itween.pixelplacement.com/index.php