# how can I stop instantiate process

I want to instantiate a GameObject 200 times in special position (as a block for player) and stop this process after 200. but I dont know how :). this is my code
using UnityEngine;
using System.Collections;

``````public class Intastiating : MonoBehaviour {

public GameObject player;
public GameObject block1;
public GameObject block2;
public GameObject[] blocksNum;
int b1Y = Random.Range(-34,29);

void Update ()
{
Instantiate (block1,new Vector3 (b1Y,block1.transform.position.y + 15.5f,0),Quaternion.identity);
Instantiate (block2, new Vector3 (b1Y + 27.4f, block2.transform.position.y + 15.5f), Quaternion.identity);

blocksNum = GameObject.FindGameObjectsWithTag("Block");

if (blocksNum.Length > 200)
{

}
}

}
``````

// Always Comment Code. Comment is for you and your team since they aren’t complied when you build your game.
// You don’t want to spend hours to go through thousands of line of unedited code to kill a single bug!
public class Intastiating : MonoBehaviour
{
public GameObject player; // Player - not initiated (will cause error)
public GameObject block1; // Block Type 1 - Not initiated (will cause error)
public GameObject block2; // Block Type 2 - Not initiated (will cause error)
public GameObject blocksNum = new GameObject[0]; // Number of Blocks
int b1Y = Random.Range(-34, 29); // Random X-Position.
void Update()
{
if (blocksNum.Length < 200)
{
Instantiate(block1, new Vector3(b1Y, block1.transform.position.y + 15.5f, 0), Quaternion.identity); // Unnecessary Complex
Instantiate(block2, new Vector3(b1Y + 27.4f, block2.transform.position.y + 15.5f), Quaternion.identity); // Unnecessary Complex
blocksNum = GameObject.FindGameObjectsWithTag(“Block”); // Bad Programming.
}
}
}