- Home /
how to test Buttons
Hello,i have a button and it stopped working this version.
the script for it is fairly simple:
go.endbutton.GetComponent ().onClick.AddListener (delegate { endturn (); });
however endturn is no longer called.
I changed a bit in the scene and i think it messed up some buttons. With a maximized screen no buttons work, with a minimized atleast some work.
i have a similar issue with an other button too.
How can i check best if the button receive the click and what do i do if it does not.
$$anonymous$$y issue solved itself somehow, i dont know why. However i would still like to know how to debug this kind of problem.
Debug text= text that changes on click? $$anonymous$$aybe an approach to find out if it receive clicks. But as i see it the button did not receive clicks.
Answer by knorke · Sep 28, 2017 at 07:29 AM
Whatever your OnClick function on the button is, add a "Debug.Log("Clicked") to it. This way the console will show you if the button received a click.
Also if the buttons are unclickable there might be something over it e.g. a panel that is blocking the click.
Your answer
![](https://koobas.hobune.stream/wayback/20220612084938im_/https://answers.unity.com/themes/thub/images/avi.jpg)