I really hope this is the right place to post this. I’m not sure if this is something that is better in the ANSWERS area… you know, being new and all. I don’t think “why is my button broken” is a good topic for that section though, so i’m trying this out. Here goes:
I’ve done a few tutorials, and now I’m doing my own very basic game for practice before I really dive into UNITY. It’s for mobile devices as you might imagine for a first time practice game. Anyhow, I’ve gotten plenty of buttons to work without issue, struggled a bit with some toggle UI but got that going as well, and now I’ve run into a set of buttons that I can’t get to work no matter what I do.
Stripping it down to essential info:
I have 2 buttons that come up on the HUD UI when game is over (along with Text that says Game Over, very original, I know). The 2 buttons in question are children of a panel. That panel has a CanvasGroup component. I have had no problem getting that CanvasGroup to show up and become interactable at the end of the game. The two buttons, however, are not working on click. I have them set to run a function on click that loads a new scene (either a retry of the scene just attempted, or the main menu scene). It looks like this:
Now, my settings are literally exactly the same as working buttons I have in the MainMenu scene. Something like this:
I don’t get any errors in the console, I don’t get any odd behavior, the buttons just don’t click. They don’t show as disabled (the sprite changes to gray if they are), but they also don’t change to highlighted sprite on hover.
I can’t for the life of me track down what is blocking them from my mouse click. It’s like there is some other panel in front of them, but there isn’t… as far as I can see. This is the canvas hierarchy with that home button highlighted:
So… that’s the LONG and short of it. I can’t figure it out. I’ve crawled all over the answers section looking for insight on buttons and GUI… actually learned some helpful things that I’ve implemented like using CanvasGroups rather than active/inactive panels… but nothing is changing the underlying problem of these 2 buttons causing me misery. Hopefully someone out there can spot whatever stupid mistake I’m making… or at least the one that relates to these 2 buttons.
Thanks in advance!