GUIStyle Problem

When I changed the text opacity in text color field, I get this error: NullReferenceException: Object reference not set to an instance of an object…

I need to hide the text, in this case, counter numbers. Anyway to do this without get any error?

Thanks

How are you rendering the text? Is it in a monbehaviour’s OnGUI()?

If the latter, do it like this(wrote it in webbrowser, might have errors)
void OnGUI()
{
if(drawText) // a boolean inited by you, can be anything
{
GUI.Label(new Rect(8, 8, 240, 20), “YOUR TEXT”);
}
}

If the former, learn how to use GUI functions in your monobehaviour.