- Home /
UI Button is not Detecting Mouse Click
The title tells the tale. My UI Buttons are not detecting mouse click at all. Using unity 5. Yes the UI Button has a canvas as a parent. and yes it has a canvas renderer! Im stull new to this unity visual gui stuff. Please help!
I don't really understand why a canvas is needed.
However, what is the script that you have associated with your UI?
@bmrx a canvas is one of the components associated with the UI. If put together properly the UI doesn't need scripts, it just works.
Answer by DoTA_KAMIKADzE · May 01, 2015 at 01:08 AM
Do you have EventSystem in your Hierarchy view? If no then you should add it, if yes then provide us screenshots with settings of EventSystem, UI Canvas and Button itself.
P.S. Okay now that finally you have provided screens - change your Canvas GraphicRaycaster BlockingMask from Nothing to either Everything or UI(or whichever layer your button is).
P.P.S. Ok, I've quoted my last comment over here (if you believe that to be the final answer):
But still your choice of moving your button straight to main ui canvas - I'd not consider it as a solution, unless you need one of those 2 other parents to stop its child from receiving click event, and from the point to which we came it was pretty much obvious that one of those 2 causes that (that's why moving to reconfigured main UI canvas worked).Your button seems fine to me. Does it have any visual effects? As for the click you've said it to enable queueRead - note that your button won't disable it afterwards (just in case you didn't know).
If it doesn't get clicked at all then there should be something in its parents, as I see you have HUD => HUD => QueueReader, so far I'm only sure that you have configured the first HUD if that was it on that screenshot before, so check the rest or provide their settings as well.
What problems? Upload your images anywhere and just add it here using Image button (Ctrl+G).
You'll also need a GraphicsRaycaster attached to the Canvas. Unity normally does this by default, however its worth checking.
Your answer
Follow this Question
Related Questions
UI Button multiple parameters 6 Answers
Move gameobject to button in new 4.6? 0 Answers
Buttons not Clickable inside of ScrollView 0 Answers
Force Unity UI element to refresh/update? 4 Answers
Why isn't curved UI asset working? 0 Answers