how to set a GameObject variable to a GameObject[] variable ? - C#

Basically i’m storing a bunch of GameObjects that I want to spawn when the player goes to a new scene, but I can’t instantiate them from an array.

I’ve tried this:

    //declared at the beginning
    	public static GameObject[] companions = new GameObject[100];
    //called in the Start() function
if (companionStatus  *== 1) {*

_ GameObject npc = GameObject ;_
* npc = Instantiate (npc, pos, Quaternion.identity) as GameObject;*
but it doesn’t recognise the GameObjects in the array quite the same as a plain GameObject variable. Is it possible to store GameObjects into an array and then set individual GameObjects from them?
any help would be appreciated!

It’s totally possible. If it’s not working then you are assigning the values of the companions in a bad way.

GameObject npc = GameObject *;*

this line should be:
GameObject npc = companions ;