Instantiate commands creating infinite number of clones

public class TrapMaker : MonoBehaviour {

	public int trapSizeHorizontal = 5;
	public int trapSizeVertical = 5;
	public float trapCellWidth = 64.0f;
	public float trapCellHeight = 64.0f;
	public GameObject cell;
	void Start () {
		GameObject inst = null;

		Vector3 pos = transform.position + new Vector3(-1, -1, -0.1f);
		inst = (GameObject)Instantiate (cell, pos, Quaternion.identity);


	void Update () {

I only have these.
However, somehow when I play in main, it creates something like this under Hierarchy:

and so on.

If it is not the code, what could be the problem?

Thank you.

It looks like you have ‘cell’ initialized with the game object this script is attached to. Each time it Instantiates() a clone, the Start() of the clone is run creating a new copy. The new copy creates a copy, and so on. The fix would be to not have this script on the game object being cloned.