If all you want is the object to be following the camera of one axis you could just set the position of the object to be in a certain position relative to the camera.
For Example you would attach this to the camera.
var cameraToFollow : Transform;
function Update () {
transform.position.z = cameraToFollow.position.z + 10;
}
This would just set the position of the object 10 away on the z axis.