error CS0120: An object reference is required to access non-static member

So I am working on a script that has the camera zoom out and I keep getting this error
error CS0120: An object reference is required to access non-static memberUnityEngine.Camera.fieldOfView’`

using UnityEngine;
using System.Collections;

public class ZoomOut : MonoBehaviour {
	int zoom = 20;
	float smooth = 5;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	void OnCollisionEnter2D(Collision2D coll) {
		Debug.Log("Hello");
		Camera.fieldOfView = Mathf.Lerp(Camera.fieldOfView,zoom,Time.deltaTime*smooth);

	}


}

Please help me,
Thanks!

You code attempts to set a property (the field of view) of a class (Camera) while it should be setting the property of a object of type class.

Camera.fieldOfView=value;

is like saying “the field of view of cameras” while the correct synatx is “the field of view of a camera”.

Camera camera=//get camera;
camera.fieldOfView=value;

in this case “the field of view of the main camera”, i.e.

Camera camera=Camera.main;
camera.fieldOfView=value;

or equivilantly

Camera.main.fieldOfView=value;