Dude, would not it be interesting for you not to move the camera and the player, but only the obstacles?
Because it makes it so much easier for you to handle mechanics, and the fluidity of the game is never going to be influenced. For example, each ball will have in its Update () method a line of code that will decrease the "transform.position.x", so they will always go through the player and give the impression of progression, and this way you can still stipulate an xMin that would be the value at which it disappears from the camera and when it reaches this value you destroy it and create a new one further ahead.
It would be something like this, more or less, because I'm making a headache:
public float xNovo=15 //Estes valores sao hipoteticos, imagine que o seu player esta
na posicao 0, e a camera consegue alcancar ate o 10, logo o 15 estaria 5 posicoes a frente.
public float xMin=-15 //Se a camera alcanca ate o 10 para a frente o mesmo vale para tras,
logo o -15 seria 5 posicoes apos a bolinha ultrapassar a camera
public GameObject novaBolinha; //Aqui voce arrasta o prefab da bolinha
void Update(){
transform.position= new Vector3(transform.position.x-2,transform.position.y,
tranform.position.z); // nesta linha a bolinha vai andar constantemente para tras
e o valor 2 seria a velocidade;
if(transform.position.x<=xMin){
float yNovo = Random.Range(10.0f,0.0f); //Esta linha gera um y aleatorio para o novo
obstaculo, lembre que os valores podem variar no seu projeto
Instantiate(novaBolinha,new Vector3(xNovo, yNovo, 0),transform.rotation); // ira criar
a nova bolinha la na frente
Destroy(this.gameObject); //Voce destroi o objeto por ultimo por questoes estruturais
de ordem de execucao
}
}
Sorry for some error in the code, but it was just to try to expose the idea, hopefully help! :)