using UnityEngine;
using System.Collections;
public class SpawnObstacle : MonoBehaviour {
public GameObject obstacle;
float x = 0;
void Update(){
float y = Random.Range(-6.766665f, -0.1744022f);
if (x < 1000)
Instantiate (obstacle, new Vector3 (x * 6.0f, y, 0), Quaternion.identity);
x++;
Debug.Log (x);
}
see if you fine whats the problem is on line 16,9 i can seam to fine the problem