Question by
awang · Nov 09, 2015 at 01:04 PM ·
gameobjectunity5nullreferenceexceptionsetactive
NullReferenceException when using gameObject.SetActive(false);
I have published my app on the ios app store last week.
I'm using unity 5 and using Game Performance service to track my app's bugs or errors.
One of the report confused me and I have no idea to fix it.
The report is :
And here is the code,CommonTooltipCarrayOverPanel is a MonoBehaviour:
public void OnCloseBtnClick()
{
UnShow();
}
public void UnShow()
{
gameObject.SetActive(false);
}
So , why the MonoBehavior is running it's code but the attached gameobject is null?
20151109134402.png
(8.8 kB)
Comment
Your answer
Follow this Question
Related Questions
Grenade damage script error 0 Answers
Why does GameObject.Find() work in ones and not in others? 1 Answer
Null Reference Exception ONLY (sometimes) when loading the scene... 1 Answer
How to keep bool true even when other method try to set it off 0 Answers
(Solved) Findout if an object exist in the scene, but dont trow exception 1 Answer