Need Help Making Camera Follow child of GameObject

I’m making a multiplayer game where I have a 3d tank and I would like the camera to follow the turret, so that when it rotates the camera follows. How would I go about doing that? Here’s my code for spawning in the camera, and getting it to follow the player.

public class SetupLocalPlayer : NetworkBehaviour {

void Start () {
	if (isLocalPlayer) {
		GetComponent<CarMovement> ().enabled = true;
		GetComponent<Shoot> ().enabled = true;
		GetComponent<TurretRotation> ().enabled = true;
		GetComponent<GunMovement> ().enabled = true;
		SmoothCameraFollow.target = this.transform;
	}
}

}

Put this line of code on the script attached with the player:

Camera.main.transform.SetParent (this.transform);