- Home /
Only buttons closest to EventSystem (or last in the list under Canvas?) work.
I am now on hour 4 of trying to solve this issue, reading countless threads, I really hope someone has seen this issue before, I'm getting desperate here. I have 3 groups of buttons in my Canvas that get active at different times. Those 3 sets of buttons are Pause, Stage Clear, and Game over. They all work fine, if they are the closest one to the event manager on the hierarchy. As you can see in the picture below, the groups of buttons in Stage Clear will work since it is closest to Event System, while the other buttons will not animate or be clickable.
If I move the "GameOverBackground" below "StageClearBackground", that one would be the one that works while the other two will not animate or be clickable. As shown below:
Same goes for if PauseButton gets moved down closest to EventSystem. I'm not sure why EventSystem isn't allowing all of my buttons to be clickable. Is the hierarchy wrong somehow? Any help would be greatly appreciated with this.
So I finally discovered that the reason I couldn't click anything besides the bottom was because they were overlapping. I was clicking the top layer which was the bottom most UI element. I fixed the issue by moving each layer off screen and having it slide in via animation when they are needed one at a time. On one of them I also had "blocks raycast"checked on the Canvas Group which also prevented me from clicking it.
So the case is solved before this even got approved. I hope this solution helps other people who get stuck on this for hours like I was.
Answer by Negede · Dec 21, 2017 at 09:44 PM
I'm facing the exact same problem. And i am now on hour 6 of reading through posts and trying different workarounds. Some guy mentioned that a Graphics Raycaster was needed in the scene, but that fixed it for ONE playthrough. Now it's all bugged up again. Graphics Raycaster still in scene.
please tell me if you solved this @RevolverOctorok
// edit: sry for the notification. I forgot to see your followup answer
seeing your answer about overlapping elements i found out that my buttons were children of a text object, that had overlapping width with the others. I didn't need to slide it in. I just needed to make sure that the text objects weren't overlapping. Now it actually works. Your post helped!
Your answer
Follow this Question
Related Questions
What's a good book to learn scripts for Unity? 1 Answer
Trigger an event from editor script? 0 Answers
How do disable uGUI/EventSystem selection feature? 0 Answers
Scaling the space between GUI elements 2 Answers
Tutorials for 2D game GUI 2 Answers