Buttons don't work sometimes.

A strange bug is happening in my game. Sometimes the buttons cannot be pressed, the rest of the game works normally, but all the buttons stop working even though they are all enabled.
The strangest thing is how the player can solve this problem. If the user minimizes the game and then returns, the buttons will function normally again.
Can someone help me? I’ve tried everything and nothing seems to solve it.

You’ll have to provide more information, starting with what “the buttons stop working” actually means. I don’t know if that means they click and depress from the click but what the button is supposed to do doesn’t happen, or that means it acts as if something is in the way of the button, or something else.

1 Like

I would start by putting some instrumentation in to reveal if the program is actually sensing touches (any touches… just print them all, including coordinates and phases each frame)) still when it becomes unresponsive. That way when it becomes unresponsive you can isolate if it is your program logic, or something completely external to you.

1 Like

The game is able to notice when the player clicks, but the player is unable to click any buttons, although these buttons are activated, it is as if he were clicking on images. I suppose it is something external to me, because the game returns to normal after the player minimizes and returns to the game and I have not programmed anything that interacts with this type of event.

I just checked here, the game can identify the position of the mouse normally when the player clicks, apparently the problem is really with the buttons, despite their properties being normal in the inspector.