Multiple Canvas' with buttons - onclick doesn't work

Hello, dear community,
I have 3 canvas’ in my game, two of those contain a button and one contains raw image. All have render mode screen space - camera. Now, my problem is that I can only click one of the buttons, the other button does not react to clicks anymore. I already tried giving different layers orders, so 0 for one canvas, 1 and 2 for the others, but did change anything. It worked fine before I set the render mode to screen space.
Here are my canvas settings:

How do I fix that?

Edit: Solved. I found out that I didn’t have Raycast Target enabled on the second button. If you have the same problem, that one button works and the other one does not althought you have an onclick added, first compare the settings of both buttons. Maybe you clicked somewhere accidently without noticing it.

Put all buttons on one layer. If you need to turn them on and off do so by myButton.gameObject.SetActive(true)

1 Like

Also, please try to post in the correct section the next time, which in this case would be UGUI or General Support.

Thanks :slight_smile:

Thank you for your reply. I found out that the problem was that I didn’t have “Raycast Target” enabled on the second button. Everything works fine now.

3 Likes