- Home /
Unity UI click through problem ( seems to be a common problem :( )
Hello :).
Sometimes Unity is really driving me crazy and is making thinks hard that should not be.
Right now I'm trying to create an overlaying UI which shows something like settings whatever. The problem is that the mouse is clicking through all my UI-elements. Buttons, Images, etc. I supposed there would be a simple checkbox on a canvas like 'allow click through' but.... hell, no... there is nothing like this.
I googled and this seems to be a common problem. I already found some 'solutions' that are either not working for me or are not very suitable for an existing project like changing all input script etc.
I tried to add a CanvasGroup to my Canvas or to the Backgroundimage or to the parent GameObject and tried different settings with it but nothing is working for me.
So my question is: What is the best solution to prevent clicks through UI-elements for a running project? Is there a way to add a script to a canvas which simply catches all clicks or something like this?
Any help is really appreciated.
Ensure you have an EventSystem in your hierarchy. Also check to make sure UI objects you want to be interacted with have the "Raycast Target" option checked.