Trying to turn the Tank Game Camera script into perspective projection.

So I am using the Tank game camera script and changed a few things up to track my players as they spawn into the scene. Everything works perfect if the camera projection mode stays in orthographic, but I want the view to be 3D so I need to make it work for perspective movement. At the time it works but only following players left and right on the x axis and it is not moving up and down with the y axis, nor is it zooming in and out like it is supposed to. This is my script:

using UnityEngine;
using System.Collections;

public class CameraSmash : MonoBehaviour {

	public float m_DampTime = 0.2f;                 // Approximate time for the camera to refocus.
	public float m_ScreenEdgeBuffer = 4f;           // Space between the top/bottom most target and the screen edge.
	public float m_MinSize = 6.5f;                  // The smallest orthographic size the camera can be.
	public Transform[] m_Targets; // All the targets the camera needs to encompass.

	private Camera m_Camera;                        // Used for referencing the camera.
	private float m_ZoomSpeed;                      // Reference speed for the smooth damping of the orthographic size.
	private Vector3 m_MoveVelocity;                 // Reference velocity for the smooth damping of the position.
	private Vector3 m_DesiredPosition;              // The position the camera is moving towards.

void Update () 
{
	
	GameObject[] gameObjects = GameObject.FindGameObjectsWithTag ("Player");
	m_Targets = new Transform[gameObjects.Length];
	for (int i = 0; i < gameObjects.Length; i++) {
		m_Targets _= gameObjects*.transform;*_

* }*
* }*
* private void Awake ()*
* {*

* m_Camera = GetComponentInChildren ();
_
}*_

* private void FixedUpdate ()*
* {*
* // Move the camera towards a desired position.*
* Move ();*
* // Change the size of the camera based.*
* Zoom ();*
* }*
* private void Move ()*
* {*
* // Find the average position of the targets.*
* FindAveragePosition ();*
* // Smoothly transition to that position.*
* transform.position = Vector3.SmoothDamp(transform.position, m_DesiredPosition, ref m_MoveVelocity, m_DampTime);
_
}_
_
private void FindAveragePosition ()_
_
{_
_
Vector3 averagePos = new Vector3 ();_
_
int numTargets = 0;_
_
// Go through all the targets and add their positions together._
for (int i = 0; i < m_Targets.Length; i++)
_
{_
_
// If the target isn’t active, go on to the next one._
if (!m_Targets.gameObject.activeSelf)
_ continue;
// Add to the average and increment the number of targets in the average._
averagePos += m_Targets.position;
_ numTargets++;
}
// If there are targets divide the sum of the positions by the number of them to find the average.
if (numTargets > 0)
averagePos /= numTargets;
// Keep the same y value.
averagePos.y = transform.position.y;
averagePos.z = transform.position.z;
// The desired position is the average position;_

m_DesiredPosition = averagePos;
_ }
private void Zoom ()
{
// Find the required size based on the desired position and smoothly transition to that size.
float requiredSize = FindRequiredSize();_

m_Camera.orthographicSize = Mathf.SmoothDamp (m_Camera.orthographicSize, requiredSize, ref m_ZoomSpeed, m_DampTime);
_ }
private float FindRequiredSize ()
{
// Find the position the camera rig is moving towards in its local space._

Vector3 desiredLocalPos = transform.InverseTransformPoint(m_DesiredPosition);
_ // Start the camera’s size calculation at zero.
float size = 0f;
// Go through all the targets…_

for (int i = 0; i < m_Targets.Length; i++)
_ {
// … and if they aren’t active continue on to the next target._

if (!m_Targets.gameObject.activeSelf)
_ continue;
// Otherwise, find the position of the target in the camera’s local space._

Vector3 targetLocalPos = transform.InverseTransformPoint(m_Targets.position);
_ // Find the position of the target from the desired position of the camera’s local space.
Vector3 desiredPosToTarget = targetLocalPos - desiredLocalPos;
// Choose the largest out of the current size and the distance of the tank ‘up’ or ‘down’ from the camera.
size = Mathf.Max(size, Mathf.Abs(desiredPosToTarget.y));
// Choose the largest out of the current size and the calculated size based on the tank being to the left or right of the camera._

size = Mathf.Max(size, Mathf.Abs(desiredPosToTarget.x) / m_Camera.aspect);
_ }
// Add the edge buffer to the size._

size += m_ScreenEdgeBuffer;
_ // Make sure the camera’s size isn’t below the minimum._
size = Mathf.Max (size, m_MinSize);
_ return size;
}
public void SetStartPositionAndSize ()
{
// Find the desired position.
FindAveragePosition ();
// Set the camera’s position to the desired position without damping._

transform.position = m_DesiredPosition;
_ // Find and set the required size of the camera._
m_Camera.orthographicSize = FindRequiredSize ();
_ }
}*_

Nevermind I figured it out, had to literally take out the line that keeps the same y value…need more coffee
averagePos.y = transform.position.y; //delete this line