Array only using first 2 in it

In the inspector window it is only taking the first 2, I have moved all prefabs around in different orders in the inspector incase it was one of the prefabs causing an issue cause as of right now I only have 3 but no matter what I put where its only element 0 and 1 that spawn out, I ran the game for 1 hour straight incase it was the random spawning but I don’t think that is causing an issue because the 3rd prefab never spawned in. Any ideas on what I have done wrong in my script below?

public GameObject[] enemies;
private float width = 9.5f;
private float height = 7.0f;
public float spawnTime = 1.5f;
private int counter = 5;
private int spesialPlace;   //for enemyS placing
private System.Random rand;
private int maxCount = 6;

// Use this for initialization
void Start()
{
    rand = new System.Random();
    //InvokeRepeating("SpawnEnemies", spawnTime, spawnTime);
    Invoke("SpawnEnemies", spawnTime);
}

public void BoostDetected()
{
    CancelInvoke("SpawnEnemies");
    Invoke("SpawnEnemies", spawnTime);
}

void SpawnEnemies()
{
    counter = 5;
    spesialPlace = rand.Next(1, maxCount);
    foreach (Transform child in this.transform)
    {
        GameObject spawn;
        if (counter == spesialPlace)
        {
            spawn = Instantiate(enemies[1], child.transform.position, Quaternion.identity);// as GameObject;
        }
        else
        {
            // Randomly choose an enemy from the array (excluding the special enemy)
            int randomIndex = Random.Range(0, enemies.Length - 1);
            spawn = Instantiate(enemies[randomIndex], child.transform.position, Quaternion.identity);// as GameObject;
        }
        spawn.transform.parent = child.transform;
        counter--;
    }
    Invoke("SpawnEnemies", spawnTime);
}

void OnDrawGizmos()
{
    Gizmos.DrawWireCube(this.transform.position, new Vector3(width, height));
}

It looks like there might be an issue with the way you are handling the spawning logic, particularly with the spesialPlace variable. When you randomly choose spesialPlace for the special enemy, it could end up being the same as the counter value, causing the special enemy to spawn in the same position as one of the regular enemies.

Try this. I modified slightly your code:

public class EnemySpawner : MonoBehaviour
{
    public GameObject[] enemies;
    private float width = 9.5f;
    private float height = 7.0f;
    public float spawnTime = 1.5f;
    private int maxCount = 6;

    void Start()
    {
        InvokeRepeating("SpawnEnemies", spawnTime, spawnTime);
    }

    void SpawnEnemies()
    {
        for (int i = 0; i < maxCount; i++)
        {
            Transform spawnPoint = transform.GetChild(i);
            GameObject spawn;

            if (Random.Range(0, 5) == 0) // 1 in 5 chance for a special enemy
            {
                spawn = Instantiate(enemies[1], spawnPoint.position, Quaternion.identity);
            }
            else
            {
                int randomIndex = Random.Range(0, enemies.Length - 1);
                spawn = Instantiate(enemies[randomIndex], spawnPoint.position, Quaternion.identity);
            }

            spawn.transform.parent = spawnPoint;
        }
    }

    void OnDrawGizmos()
    {
        Gizmos.DrawWireCube(transform.position, new Vector3(width, height));
    }
}

I’m using Random.Range(0, 5) == 0 to give the special enemy a 1 in 5 chance of spawning. This way, you don’t need a separate spesialPlace variable, and each enemy has an equal chance of being special. Make sure to adjust the probability based on your desired ratio. Also, ensure that your maxCount value is equal to the number of spawn points you have.