Multithreaded array, returning null GameObjects - Solved!

Okey, this is my error.

NullReferenceException: A null value was found where an object instance was required.
gameManager.Awake () (at Assets/gameManager.cs:37)

I am trying to create a wave list for a TD game like Balloons TD. I was going to do something like

public GameObject[,] waveSpawnList;

then assign everything in the inspector manually. so that it would be a little more user friendly to make multiple levels. Sadly, i cant get my unity to display 2d arrays. so i thought to use a little shortcut. I thought i would create a key variable, were i change one number in a list of numbers, to assign my GameObjects to each array.

well here it is, and it keeps returning null for some reason. minion1_1 and minion1_2 are assigning in the inspector.

The problem is coming from line 19

    public GameObject minion1_1;
    public GameObject minion1_2;

    private int[,] minionAssinger = {{1,1,1,1,1},{1,1,2,1,1},{1,1,2,2,1},{1,2,2,2,1},{1,2,2,2,2},{2,2,2,2,2}};
    private GameObject[,] waveMinionArray;
  
void Awake () {
        spawningMinions = false;

        for(int i = 0; i < 30; i++){
            Debug.Log ("2");
            for(int x = 0; x < 30; x ++){
                Debug.Log ("3");
                switch(minionAssinger[i,x]){
              
                case 1:

                    waveMinionArray[i,x] = minion1_1;
                    break;
                case 2:

                    waveMinionArray[i,x] = minion1_2;
                    break;
                }
            }

        }

    }

Just a guess, but you are using your code in the Awake method. You should cut this over to the void Start() function as I guess, the gameobjects are not initialized at this time. Awake I am only using for getting components in the same gameobject for example, as they are there if the gameobject itself is present. But accessing other gameobjects could end up in error nullreference.

Good thinking.
Just tried that, same problem. =/
i also used a debug.log to check if the objects are declared on time, they are. this is very frustrating, is their a better way to make a wave spawn list?

waveMinionArray needs to be initialized before you can assign to it.

thank you! that worked. this is my new code. it works just fine now.

    void Awake () {
        spawningMinions = false;
        waveMinionArray = new GameObject[6,5];
    }

    void Start(){

        for(int i = 0; i < 6; i++){

            for(int x = 0; x < 5; x ++){

                switch(minionAssinger[i,x]){
                   
                case 1:

                    waveMinionArray[i,x] = (minion1_1)as GameObject;
                    break;
                case 2:

                    waveMinionArray[i,x] = (minion1_2)as GameObject;
                    break;
                }
            }
           
        }

    }