Есть два класса:
public class SpawnBox : MonoBehaviour {
	public Object obj;
	public GameObject gObj;
	public float min;
	public float max;
    private float inq;
    int turn;
    void Start()
    {
      
    }
	void Update () {
	}
	
    public void Spawn()
	{
        gObj.transform.position = new Vector3(Random.Range(-12.9f, 12.9f), Random.Range(21.0f, 51.0f), 0);
        Instantiate(obj, gObj.transform.position, Quaternion.identity);
	}
}
public class Rand : MonoBehaviour {
    int dawn;
	void Start () {        
	}	
	void Update () {
	    if(Input.GetKey(KeyCode.Q))
        {
            dawn = Random.Range(0, 10);
            if(dawn == 3)
            {
                GetComponent<SpawnBox>().Spawn();
            }
            else
            {
                print(dawn);
            }                
        }
	}
}
Выдаёт NullReferenceException в строке с: "GetComponent().Spawn();
"
Я пробовал создать экземпляр класса, то же самое =(