A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by xFrost96x, Sep 14, 2016.
Hi , why my button can't be pressed??
Here is my screenshot:
- Make sure the graphic has "raycastTarget" set to True.
- Make sure the button has its "interactable" set to True.
- If there's a nested canvas in the button's parent, that canvas also needs GraphicsRaycaster.
If all those are fine, then start the game, select your EventSystem and click your button. At the bottom of the inspector you'll see what your click hit (in that dark box that is visible in the first screenshot). It might be something else capturing the click before the buttons.
I added GraphicsRaycaster to the parent and it fixed my problem! Thanks so much!
Thank you!!Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! I spent the last three hours looking for the reason why my buttons weren't working. I knew something had to be blocking them but couldn't figure what. You are the first and only person that I have found that game me an actionable way (besides going through every object in my scene) to figure out what was the problem. YAY!!!!
An event system should be automatically added to your scene when you add a canvas. If you need one for something else (and have no canvas), you can add it yourself. You can also add it yourself if you accidentally deleted it
Awesome! Thanks, man.
If your still having problems after doing the above I found that my problem was that in the buttons 'On Click ()' settings. I had set for the button to change the sprite in an image component although I had left the sprite reference equal to none. Make sure you guys haven't left out any references in the 'On Click()' settings.
This is what the problem was:
Id just like to say be sure you have things "ordered" correctly in your manager. It looks like your buttons may be behind your panel.
In my case I forgot that I had a canvasgroup component on the button's parent. The "Interactable" and "Blocks Raycasts" options have to be ticked to allow the interaction with the child buttons.
here is my screenshots. I still can not click on UI button!
Aw damn. Seems like I did just that. Finally I know why nothing's working. Did a bit too much cleanup in my project files
I didn't have an events system in my scene, putting one in solved my problem.