My buttons sometimes don't work

When I run the game to test it, sometimes the buttons press normally, but sometimes the buttons don’t press at all.

default
image

when mouse hover
image

something wrong
image

Button doesn’t react when mouse hover and click.

The script simply turns on and off the enable property of the parent screen gui object. This often happens when testing with two player in a studio. I’d like to know if this is just a bug in Roblox Studio or if I did something wrong.

2 Likes

Issue Breakdown:

  • Default State: The buttons appear as intended, with the correct positioning.
  • Mouse Hover: The buttons visually indicate that they are being hovered over (e.g., by changing color or appearance).
  • Something Wrong: The button doesn’t react when clicked or hovered over.

Possible Solutions:

  1. Check the Script: Double-check the part of the script that enables and disables the parent GUI to make sure it’s not interfering with the buttons in any way.
  2. ZIndex and Transparency: Make sure the buttons aren’t hidden behind another UI layer. Look at the ZIndex settings to confirm the buttons are on top.
  3. Reconnecting Events: If the GUI gets turned off, make sure the mouse click events are being reconnected properly when it turns back on.
  4. Test Different Scenarios: Try testing the game with just one player or on different devices to see if the issue still happens. If it works fine in other situations, it might be worth reporting the bug to Roblox.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.