- Home /
My UI Button has phantom clicks whenever I click on it
Hey guys
It's my first time posting to the forums so forgive me if this isn't the place for this kind of question...
I created a UI Button in my canvas that I put on a plane, and when I run the game and click on it, it keeps blinking and it registers multiple clicks.
I even tested with Debug.Log and printed something everytime I would "click" on the button, and my console is flooded with prints even though I pressed on the button once...
Thank you for the help
Have you assigned the 'OnClick()' behaviour via script or editor? I can't replicate your problem...
Answer by TinyMuffin · Nov 15, 2021 at 01:31 PM
I had the same issue. My problem was a game controller which was connected to my PC. The UI received input from it. I unplugged it and everything worked as expected.
Just wanted to say - I've been banging my head against the wall with this exact problem for an hour, and after much googling and frustrated cries of "but how can it be my code?? this was working last time I had the project open!" yours was a the comment that finally solved this for me! Had my bloody Switch Pro plugged in after playing Elden Ring. Thank you so much!
Answer by Collywog · Mar 14, 2019 at 06:00 AM
Are you using the event manager or scripting it yourself?
I'm not using an event manager, I simply placed a button with Create -> UI -> Button and I added a layout element on it.
Is this in a new scene, or is your menu already affected by other scripts?
Wherever I place a button, even if I would create a new one right now anywhere, it does the same thing...