My pellet spawning system crashes my unity at Play (not launch my bad)

I’ve been scratching my head for days trying to implement this.
essentially I just want something that will spawn a pellet (little red ball) for the player to enjoy. the game runs fine without this script running.

I disable

public bool spawning;

and it works fine, I enable it my unity stops responding and crashes, I know I’m doing something wrong, I just don’t know what. here’s the full script, can someone be kind enough to point me in the right direction to fix this?

thank you very much in advance.

using UnityEngine;
using System.Collections;

public class PelletSpawn : MonoBehaviour {

	public GameObject pellet;
	public float spawnDelaymin, spawnDelaymax;
	private float waitTime;
	public bool spawning;

	// Use this for initialization
	void Start () {
		//Defines starting pause before spawning pellets
		waitTime = Random.Range (spawnDelaymin, spawnDelaymax);
		//start the pellet spawning
		StartCoroutine (Spawn ());
	}
	

	void FixedUpdate () {
		//Randomizes the wait time each "spawn cycle" persay... 
		//I think this is what is crashing my unity...
		//tried removing it yet it doesn't stop it from crashing.
		waitTime = Random.Range (spawnDelaymin, spawnDelaymax);
	}
		
	//While spawn is enabled, 
	//spawn a pellet and wait for a new cycle
	//FixedUpdate() regenerates new waitTime for random spawn rates...(?)
	IEnumerator Spawn(){
		while (spawning) {
			DropPellet ();
			yield return new WaitForSeconds (waitTime);
		}
	}

	//This function is also needed elsewhere later, not implemented yet
	void DropPellet(){
		Instantiate (pellet);
	}
}

This script spawns them all but only at origin (0,0,0)
it lags as over 500 pellets spawn for the first few seconds (after base wait time) and then they slowly delete themselves or get eaten by the player. but they only spawn in one wave and then they fail to repeat the cycle, I presume this is due to the pelletInstance if statements.

so i fixed it? it no longer crashes which was the issue I hope this helps someone down the line.

if someone wants to help with the “Spawning at origin” issue that would be great. I’m sur ei can figure it out on my own though. Help is always appreciated however,

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class PelletSpawn : MonoBehaviour {

	public GameObject pellet;
	public float spawnDelaymin, spawnDelaymax;
	private float waitTime;
	public bool spawning;

	// Use this for initialization
	void Start () {
		//Defines starting pause before spawning pellets
		waitTime = Random.Range (spawnDelaymin, spawnDelaymax);
		//start the pellet spawning

		if(spawning){
			StartCoroutine (Spawn ());
		}
	}
	

	void FixedUpdate () {
		//Randomizes the wait time each "spawn cycle" persay... 
		//I think this is what is crashing my unity...
		//tried removing it yet it doesn't stop it from crashing.
		waitTime = Random.Range (spawnDelaymin, spawnDelaymax);
	}
		
	//While spawn is enabled, 
	//spawn a pellet and wait for a new cycle
	//FixedUpdate() regenerates new waitTime for random spawn rates...(?)
	IEnumerator Spawn(){
			yield return new WaitForSeconds (waitTime);
			DropPellet ();
			yield return new WaitForSeconds (waitTime);
	}

	//This function is also needed elsewhere later, not implemented yet
	void DropPellet(){
		GameObject pelletInstance = Instantiate (pellet, parent:transform) as GameObject;

		if (pelletInstance != null) {
			spawning = false;
		}
		if (pelletInstance == null) {
			spawning = true;

		}

		Destroy (pelletInstance.gameObject, 5);

	}
}

UPDATE:
Fixed it Fully. Here’s the script incase anyone is wondering.

//so I can toggle which ones I want spawning etc.
public bool spawningA, spawningB, spawningC, spawningD, spawningE, spawningF;
//Added these, assigned them in inspector panel to- 
//-an empty game objects where I want the pellets to spawn
public GameObject spawnA, spawnB, spawnC,  spawnD,  spawnE,  spawnF; 


void DropPellet(){

		/* 
		check if spawn points are enabled
		if they are, spawn a pelet at spawnX's position.
		check others, repeat until last is checked.
		return;
		*/

		if (spawningA == true) 
		{Instantiate (pellet, spawnA.transform.position, Quaternion.identity);}
		if (spawningB == true) 
		{Instantiate (pellet, spawnD.transform.position, Quaternion.identity);} 
		if (spawningC == true) 
		{Instantiate (pellet, spawnC.transform.position, Quaternion.identity);} 
		if (spawningD == true) 
		{Instantiate (pellet, spawnD.transform.position, Quaternion.identity);}
		if (spawningE == true) 
		{Instantiate (pellet, spawnE.transform.position, Quaternion.identity);} 
		if (spawningF == true) 
		{Instantiate (pellet, spawnF.transform.position, Quaternion.identity);}

		return;
	}

Just gonna leave it here, hope it helps.