Hey developers,
I recently ran into a very frustrating issue with my inventory system in Roblox Studio, and after a lot of trial and error (and a bit of luck), I finally discovered the cause — so I want to share it here in case it helps others.
The problem
I had two different frames in my ScreenGui:
- Equipamentos → contains my equipment slots, e.g.
MeleeWeaponwith aViewportButton. - InventarioFrame → contains the inventory grid with draggable items.
When I dragged an item from the inventory into an equipment slot (the ViewportButton), the first time it worked fine. The GuiState of the button correctly switched to Hover when the mouse was on top of it.
But the second time I tried the same action, the GuiState stayed Idle even though the mouse was clearly over the button. This broke my drag-and-drop system since I was relying on the hover state to detect where the item should be dropped.
The cause
It turns out the issue wasn’t with GuiState itself, but with UI layering.
The InventarioFrame and the Equipamentos frame are siblings inside the same ScreenGui. By default, Roblox decides which one is “in front” depending on their render order.
Even though my InventarioFrame was transparent, it was still blocking mouse events, preventing the ViewportButton underneath from ever entering Hover.
The solution 
The fix was super simple:
I set the ZIndex of the Equipamentos frame to 2.
Now the equipment buttons always stay “on top” when they need to, and the GuiState properly switches to Hover every time.
Takeaways for other devs
- Transparent does NOT mean invisible → transparent frames can still block input.
- Always check your ZIndex when working with multiple overlapping UI frames.
- You can also set
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Siblingto make ZIndex handling more predictable. - If you want a frame to be “invisible to clicks,” set
Active = falseorVisible = false.
Hopefully this saves someone else hours of debugging — because I almost lost my mind before realizing it was just the ZIndex. ![]()
Give it a heart if it was helpful for you.