Hi All,
my code was working fine until yesterday. But today buttons on my canvas are not detected in build. They work fine in editor. But when I build nothing. I’ve added a bit of code to detect and log what objects the eventsystem sees and it sees background objects fine. I don’t think it can be used to see canvas objects? Using the unity example for m_MyGameObject = hit.collider.gameObject.
I should also add if I swap to a menu scene etc canvas buttons work on here, swap back and they still don’t work on my main game screen
Can anyone advise why buttons would work in editor but not build ( on the main scene )? Is there anyway I can get the eventsystem to report on these? Thanks.
1 Like
I have the same problem. Searched everywhere.
People suggest all kinds of things.
-Render Camera on the Canvas
-Z-Position of the Canvas or UI Elements
-Material/Shader of UI Elements
-SortOrder of Canvas or UI Elements
I don’t know if it’s any of these. I don’t know how to debug it. I’d love a solution or method to debug that works.
Sorry I can’t be more helpful.
I mean this probably won’t help but if you suspect something at runtime might start blocking the button you can also try the Canvas Group since that has a “Block Raycast” and “Interactable” Check Boxes.
But If i was having the issue i’d debug it by copying my scene and then just start removing more and more things until it worked again. Then try and figure out from there what breaks it when I add it back in. If you get down to a scene with a brand new canvas, new button, and event system with the issue still happening i’d submit a bug report, i mean never done a bug report but I assume unity has bug reporting somewhere on the site.
Also if either of you want to slim your project down (Remove everything that isn’t necessary to see the UI problem happening) and send it i’ll take a crack at it.
1 Like
Thanks so much @LatchGameDev , and very kind of you to offer to sort out a pared-down version if necessary.
For now, your advice a great pointer in the right direction and a smart way to debug it, I’ll see what I can do.
Can’t really help as I suspect you’ve tried my solution.
Mine was a bit of text box went over the button. My solution
- Checked all UI elements for overlap
- Made buttons last elements in Canvas
1 Like
Thanks so much, and that’s a solution that will work for some people, so I’m glad you shared it here, thank you 
Hello!
I had the same problem. I do recommend include Graphyc Raycaster (GR), but they should be placed in not overlaped areas.
I had a master “Canvas” element, parent of thers “MainMenu”, “Settings”, “Others”. The problem was I have GR on master canvas, settings and others menus. I deleted the GR on master canvas and add one to MainMenu, and all warked. I think the reason is now they are not overlaping.