- Home /
onClick stops working after a while
Can anyone give me some pointers why onClick would stop working after a while? I have a fully working game that runs without problems for a random amount of time - many minutes to hours. Then the GUI buttons stop working. Everything else continues to run. There is no sign of a crash. The game behaves exactly as if the buttons are not being clicked. Same in all scenes.
The buttons have event listeners added to them in script in the Start() routine in this format;
Button btn = yourButton.GetComponent<Button>();
btn.onClick.AddListener(TaskOnClick);
Your answer
Follow this Question
Related Questions
Button doesn't work when returning to scene (android) 1 Answer
Unity 5.0.2f1 UI Button OnClick Function 6 Answers
UI Button OnClick Function - How to get name of button that was clicked? 2 Answers
How to begin startcoroutine (IEnumerator) with UI button. 1 Answer
Method added on a button click with a delegate is being called twice. 0 Answers