MouseLeave - Strange behavior (?)

,

I recently came over some strange behavior regarding the function MouseLeave.
Apparently, it will still be active even if I hover over the chat icon, but nothing else.

Example:
https://gyazo.com/e877749863df44a5d13552c417f01bdf

Are there anything that might fix this type of behavior?
However if I move it even further from the chat icon, it seems to be fixed.

Then the real question is; Why is this not happening if I hover over the chat icon while I move my mouse to the Roblox menu button?

(This is a custom icon added by me, not Roblox.)

1 Like

Can you please show your code so that we can find out why the script is bugging out?

This is a simple MouseEnter and MouseLeave function, you can see that it works as I hover off the actual object, however when I hover right over to the chat icon, the MouseEnter seems to still be active.

I found this while browsing for MouseLeave and MouseEnter, it’s been a huge bug for many devs and people really want a fix.

That is not the issue, I only run into this when hovering over my custom one then move the mouse over to the chat icon.

MouseLeave and MouseEnter has been fixed already, there’s something with the Roblox UI that’s messing up my custom button.

1 Like

It seems like MouseLeave isn’t firing because you’re entering another GUI button, for example it only stays active when you are hovering over a different button. Make it so that when you touch another GUI button that isn’t your custom button, you make your custom button disabled.

Or just try using wait() at the beginning of your event firing

No, this ONLY happens with the chat icon one, I added a bunch of icons then tried to hover over them, it didn’t bug even once.

1 Like

Try using a wait() right after your listener fires or use a renderstepped:wait() I will get on RS to check myself as well

Fixed it by moving the button a bit farther away from the chat icon one, it’s still weird.

Moving the button away is a good idea, however for others who don’t want to move it I’ve found an awkward way. When you fire MouseEnter you disable the topbar by using

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("TopbarEnabled", false)

And when you fire MouseLeave use

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("TopbarEnabled", true)

it will disable the chat so that you can leave it but it’s kinda unconventional

1 Like

I appreciate your time, however not helpful at this time.

I changed a few things and it now works as it should – thank you anyways!

1 Like

I’m curious. Did you put it back next to the chat box? And if so how were you able to make it so that it would change?

I did put it back, I changed my design so it wouldn’t include mouse input at all (Except for MouseButton1Click), which doesn’t disturb anything.

1 Like