Issue with setting Camera Location

Hello, I have a small problem with using the camera in a 2D environment. I wrote a simple script to set it’s location to the average of two points (players) but the camera simply shows white. The script compiles perfectly fine, and has no errors, so what is the problem?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CamMov : MonoBehaviour {
	
	public GameObject player1;
	public GameObject player2;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		transform.position = player1.transform.position + player2.transform.position / 2;
		if (transform.position.z == 0)
	}
}

hey to find the middle of two position use this code :

transform.position = Mathf.lerp ( player1.transform.position  ,  player2.transform.position , 0.5f)  ;