Can't make Quaternion rotation work :(

I’ve never tried this before, so I honestly don’t really know how to make this work… I’ve already looked at UnityScriptReference and it helped me at least fix two lines of the code, but I’m not sure what to do about Quaternion tempRot = target.transform.rotation + rotation; it says that Operator ‘+’ cannot be applied to operands of type ‘Quaternion’ and ‘Quaternion’

using UnityEngine;
using System.Collections;

public class SmoothCamFollow : MonoBehaviour {

public GameObject target;
public float smooth; 
public Vector3 position;
public Quaternion rotation;

void FixedUpdate () {
    Vector3 tempPos = target.transform.position + position;
    Quaternion tempRot = target.transform.rotation + rotation;
    transform.position = Vector3.Lerp(transform.position, tempPos, Time.deltaTime * smooth);
    transform.rotation = Quaternion.Slerp(transform.rotation, tempRot, Time.deltaTime * smooth);

    transform.LookAt(target.transform);
}

}

You need to use multiplication to combine Quaternions.

You’re also doing a LookAt right after you set the rotation. LookAt sets the rotation, so the rotation = line won’t have any effect.

You can use my FollowVehicle script if it’s like something you want

using UnityEngine;
using System.Collections;

public class FollowVehicle : MonoBehaviour {

    public Transform targetTM;
    public float distance = 10.0f;
    public float height = 10.0f;
    public float speed = 5.0f;
    public bool smooth = false;
    public enum ViewPoint
    {
        Back = 0,
        Front,
        Right,
        Left
    }
    public ViewPoint direction;

	// Use this for initialization
	void Start () {
        direction = ViewPoint.Back;
	}
	
	// Update is called once per frame
	void LateUpdate () {
        var axis = targetTM.up;
        //project on xz plane
        var projected = new Vector2(axis.x, axis.z);
        switch (direction)
        {
            case ViewPoint.Back:
                axis = new Vector3(axis.x, .0f, axis.z);
                break;
            case ViewPoint.Front:
                axis = new Vector3(-axis.x, .0f, -axis.z);
                break;
            case ViewPoint.Right:
                projected = Rotate(projected, 90.0f);
                axis = new Vector3(projected.x,.0f, projected.y);
                break;
            case ViewPoint.Left:
                projected = Rotate(projected, -90.0f);
                axis = new Vector3(projected.x,.0f, projected.y);
                break;
        }
        //camera position 
        var camPos = targetTM.position + axis.normalized * distance + Vector3.up * height;
        if (smooth)
        {
            var tempPos = transform.position;
            transform.position = Vector3.Lerp(tempPos, camPos, speed * Time.deltaTime);
        }
        else
        {
            transform.position = camPos;
        }
        transform.LookAt(targetTM.position);
	}

    public Vector2 Rotate(Vector2 v, float degrees)
    {
        float sin = Mathf.Sin(degrees * Mathf.Deg2Rad);
        float cos = Mathf.Cos(degrees * Mathf.Deg2Rad);

        float tx = v.x;
        float ty = v.y;
        v.x = (cos * tx) - (sin * ty);
        v.y = (sin * tx) + (cos * ty);
        return v;
    }
}