How to smooth out camera movement?

It’s a 2D sidescroller… I’m using Vector3.Lerp to move the camera… and whenever the player starts going faster like when he’s falling the camera starts to jitter like crazy. If I add a LookAt function it smooths it out nicely, but I just want the cam to look straight forward. Also I tried having the cam just look at a vector directly in front of it, but the jitter cam back with that.

Post your script please. Or, if it’s really long, post the part that moves the camera. Post the part that gets the position of the object the camera is trying to follow, too.

unity has a built in script for this, smooth follow, use the 2D one.

Sorry I’ve been traveling for the past couple days and haven’t had the time to check on the forum. Anyways… this is my current camera script… or at least everything that needs to be posted (Sorry for not posting it earlier)

I wanted the camera to have a lag behind it like the damping in the built in smooth follow script… but there are some rotation functions that I need the camera to do that don’t play nice with that script. Also I did take out the rotation bit but I tested it without and the problem is still there.

using UnityEngine;
using System.Collections;

public class camera : MonoBehaviour
{
	public Transform target;
	
	public float followSpeed = 1.0f;
	
	public float verticalOffset = 0.0f;
	public float horizontalOffset = 0.0f;
	public float distance = 10.0f;
	
	void LateUpdate()
	{	
		Vector3 targetPos = new Vector3(target.position.x + horizontalOffset, 
			target.position.y + verticalOffset, 
			target.position.z - distance);
		
		transform.position = Vector3.Lerp(transform.position, 
				targetPos, followSpeed * Time.deltaTime);
	}
}

I can’t see any reason that the camera should start to jitter. Sorry. The script looks fine to me.