I’m having a Unity UI problem where some of my buttons don’t react to mouse input
I have a GUI with four screens: Main Menu, Controls, Credits, and Quick Confirmation. Whichever screen is active in the scene when I begin play in editor will respond to mouse input, the others will not. The buttons that are active when the game starts will change color as I hover over them, and I can click on them to do things. The buttons that don’t respond to mouse input don’t respond at all - They don’t change color as I hover over them, and clicking has no effect
I’m using the new Input System with Unity 2019.3b
I’ve tried organizing my screens a few different ways:
- First I had one Canvas, and all the screens were children of that. I used SetActive to enable the active UI screen and disable the inactive ones, but any screen other than the initial one didn’t respond to mouse input
- Then I split each screen so they had their own Canvases, and I on screen transitions I Instantiated the new screen before Destroying the old one. Same problem: screens other than the initial one didn’t respond to mouse input
- Finally, I put all the screens in my scene and once again used SetActive to enable the active one - but this time each screen had its own Canvas, rather than all the screens being children of the same Canvas. This also didn’t work
That brings us to the question: what am I doing wrong? Why are my buttons so reluctant to work?