I’m learning to code and I want to set GameObject’s value in code instead of dragging the object over to it in the editor. I looked at other peoples questions but they didn’t work.
private GameObject brick = GameObject.Find(“brick(Clone)”);
They said that, that would set the GameObject’s value in code but when I test it, it says NullReferanceException. When I do it by settings it in the editor I don’t get this error. What am I doing wrong?