sprite array giving null reference when i drop & drag in editor

i am defining an array of sprites, i drag and drop each sprite in the editor and they show up, but once i click play all the sprite slots change to empty( i.e. [NONE]). I don’t get this, each sprite i drag n drop into the array is there and shows up…but once i click play they are all gone…why is this happening? Here is a shortened pc of code that doesn’t work:

using UnityEngine;

public class GameManager : MonoBehaviour {

    private Vector3[] picLocations;
    public Sprite[] spriteArr;

    private int numberOfPics = 3;

    void Awake()
    {
        picLocations = new Vector3[numberOfPics];

        spriteArr = new Sprite[numberofPics];  
// I have drag'n'dropped these sprites in the editor and they show up (until i click play, then they disappear).

        Debug.Log(spriteArr[0].name);
// this line gives null reference error, no matter if it's in awake, start, update, a random function, etc.
    }

Thanks in advance for any help, I am totally stumped on this one,
James

This is happening because you are clearing the array with the line:

spriteArr = new Sprite[numberOfPics];

Ok, didnt realize that, thank you! So if i want to hard code the number of elements i want in the array i should simply do that when i initially declare the array? Thanks for the help!!!

Yes but since you’re assigning elements to your array through the inspector, there’s really no point.