- Home /
Object not selected in hierarchy gives an error
Hi, I have a problem with my project. I have an object with script attached to it. If I don't select this object in the hierarchy with the mouse and run the project, it gives me an error NullReferenceException. But if I selected the object and do run, the error doesn't appear anymore. Any ideas why it happens like that?
Thanks.
PostEdit: I found the answer to the problem. I was missing a line of code "myarray[i] = new Array();", which led to this behavior.
Your answer
Follow this Question
Related Questions
Add same go as a child to multiple gameObjects in hierarchy 0 Answers
Detecting moment when GameObiect is created in hierarchy. 1 Answer
What happened when select a GameObject in editor hierarchy? 0 Answers
Having an issue with the hierarchy window 3 Answers
NullReferenceException - Editor script using GetComponent after AddComponent 1 Answer