My camera does not work

I don’t know if I already posted this but it looks like I accidentally deleted it


I have a script which moves the camera’s X to the players’s x:

#pragma strict

var player = GameObject.FindGameObjectsWithTag ("Player");
var xofplayer : float;

function Start () {

}

function Update () {
	player = GameObject.FindGameObjectsWithTag ("Player");
	xofplayer = player[0].transform.position.x;
	transform.position.Set(xofplayer,1,8);
}

I attached this to the camera and ran it. the player’s X shows up in the Inspector, but the camera does not move with it! I tagged the player “Player.”

any help?

oh and it’s a 2.5d game so I don’t need the Z position

Oh, I did it, I had to delete the main camera that came with the player Prefab (I am using the first person controller)