- Home /
NGUI Button some how unclickable
Hey all,
back with another ridiculous situation this time using the plugin NGUI.
So here's whats going on. I have a HUD which works perfectly fine on level 1. Then on level 2 there is a button that can no longer be clicked. Like it has some kind of invisible wall in front of it that eat up my clicks.
This HUD is a prefab and I have deleted it and re-added it to level 2 multiple times. Same exact result always. I have even went ahead and deleted everything else in the scene except this object. Still doesn't work. Deleted everything else in level 1 as well just to make sure the HUD can work on its own. It can.
So, any ideas what the hell is going on with this? I've tried messing with depths etc. but when everything else in the scene is off I can't imagine what it could possibly be fighting against. Especially since an identical version of it works fine in another scene.
Answer by omg_Aya · Nov 20, 2014 at 04:22 PM
Alright well here's what we did to fix this.
Go to the camera the button is being looked at by. Change its event type to 3D UI.
Go to the button that for whatever reason doesn't feel like working. Change its box collider from box collider 2D to just the normal unity Box Collider script and scale it up to size.
That's it. You literally just don't use the 2D collider with the 2D UI and it's fine.
Answer by AndyB_1992 · Aug 04, 2015 at 06:06 PM
If you have put your panel on another Layer: - Go to the Camera the layer is being rendered by - In the UICamera(Script) settings, you should see "Event Receiver Masks" - Now add the layer that your NGUI panel is on.
Answer by Nomibuilder · Jan 13, 2016 at 12:49 PM
Remove Box Collider from your Button and then
Add Component > Box Collider (Select Box Collider from there)
Now Double Click on your Button and set Collider Size according to your button size. That's It.