- Home /
Screen Space - Camera Bug (Buttons does not work) on Unity 2017
Hi everyone,
I have found an issue related with the "Screen Space - Camera" option and the buttons places on my canvas on Unity 2017 .
I have designed a bit complex UI with some buttons that open panels with additional buttons. All was going fine with "Screen Space - Overlay" option, but when I try to place some 3d models on the UI they were not drawn. Looking for internet, I found that with the option "Screen Space - Camera" the problem is fixed so I tried this approach and it works fine.
All was going ok, and I continue adding options to the UI, and in one iteration the whole UI stop working (buttons stop opening the panels). I have done some tests that I try to summarize in order to provide more details of the debug process that I followed:
Buttons worked fine on "Screen Space - Overlay" option, but 3d models were not drawn.
Switching from "Screen Space - Overlay" to "Screen Space - Camera" on play mode, does not solve the problem.
If on "Screen Space - Overlay" I press on a specific button, and then swap to "Screen Space - Camera" mode, the whole UI works fine (with the 3d Model)
I had tested some solutions related with the layers order reported on this forum, no one works.
Finally, I re-insert again the buttons on the Canvas (drag them from the canvas and placed them on the canvas object again) and the whole UI works fine.
I imagine that there is a bug related with this fact, but I do not know the reason or how to fix it correctly. Can someone provide me some additional information?
I have detected that the problem comes from a panel whose scale is define to 0,0,1 (To show / hide the panels, I am setting their scale to (0,0,1) or (1,1,1))
Placing the buttons above this panel on the Canvas, cause that the buttons stop working, while if buttons are placed under this element solve the problem.
This panel only contains two components, a "Horizontal Layout Group" and a "Content Size Fitter", and inside it I have placed two panels (to order the inside buttons on columns)
Your answer
Follow this Question
Related Questions
Buttons stopped working after I temporarily changed the font. 1 Answer
Canvas buttons too slow 0 Answers
Unable to press UI buttons in the Editor in Dual Screen Mode?? 1 Answer
Buttons scale keep changing to 0 when I import them to a non-active parent 0 Answers
Highlight button via script at runtime 5 Answers