Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: alexh0101 on July 17, 2014, 01:38:06 PM

Title: Why does my button become greyed out when I play the scene?
Post by: alexh0101 on July 17, 2014, 01:38:06 PM
Using NGUI 3.5

I have a "UI Button (Script)", a Box Collider 2D and a "UISprite (script)".
My problem is when I hit "Play", the "Normal" colour becomes grey, instead of staying white.
And the button doesn't work.

Is there anything missing in my components?
Would the button work if I used UI2DSprite instead of UISprite?


Also, when I hit Play, a new component appears in the button "Tween Color (script)".

Why is that happening?

Thanks in advance
Title: Re: Why does my button become greyed out when I play the scene?
Post by: Arcio on July 17, 2014, 02:12:26 PM
It sounds like the button is becoming inactive. In your button script, change the inactive to pink and see if it turns pink instead. If so, then that's your culprit. Just figure out what is setting it to inactive.
Title: Re: Why does my button become greyed out when I play the scene?
Post by: Nicki on July 17, 2014, 03:42:30 PM
There's probably no collider on it, which means it triggers the inactive state.
Title: Re: Why does my button become greyed out when I play the scene?
Post by: alexh0101 on July 17, 2014, 05:08:09 PM
Hi again,

Thanks for your responses.
I figured out that the box collider I had on that object was added through Unity, instead of through NGUI's right-click/Attach/Box collider.

Thanks for your help.