Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to buff / improve / enchance Roblox's Mouse Enter and Mouse Leave Events [?]

Asked by 5 years ago
Edited 5 years ago

Goal:

My goal is simply to create a Shop tooltip system.

Problem:

The problem isn't too big but it's still an issue. When I move my mouse really fast but still entering another button, Roblox seems to not pick up the MouseEnter or MouseMove though I slowed down and moving within the area.

Evidence: 19e98bdd9c093d45ed8dd6cca8ada8f5.gif https://gyazo.com/81c2fe967aa05cf1fa165d89277c2f63.gif

Script:

I don't think it has anything to do with the script but it's a localscript in a ScreenGui

--// TOOL TIP SHOP \\ --
local ShopShowToolTipSizeX = ShopToolTip.Size.X.Offset
spawn(function()
    for _, item in pairs(Shop:GetChildren()) do
        if item:IsA('ImageButton') then
            item.MouseEnter:Connect(function()
                ShopToolTip.Visible = true
                ShopToolTip.ItemName.Text = 'Name: '..item.Name
                ShopToolTip:WaitForChild('ItemDesc').Text = 'Desc: '..MovesInfo[item.Name].Desc
                ShopToolTip.ItemDamage.Text = 'Dmg: '..MovesInfo[item.Name].Damage
                ShopToolTip.ItemPrice.Text = 'B$ '..MovesInfo[item.Name].Cost
                item.MouseLeave:Wait()
                ShopToolTip.Visible = false
            end)
            item.MouseMoved:Connect(function(X, Y)
                ShopToolTip.Position = UDim2.new(0, (X - ShopShowToolTipSizeX) - 10, 0, Y)
            end)
        end
    end
end)

Any feedback on how to improve this code or solve the issue is appreciated. Thank you for reading.

0
use [link name](http:// url) for links User#5423 17 — 5y
0
imo you would be better off having just one mouse moved function to place the gui below the mouse then have the show / hide and update gui functions on the mouse neter / leave events. User#5423 17 — 5y
0
Could u leave an example? BlackOrange3343 2676 — 5y
0
A glitch roblox accidentally made is not always firing MouseLeave() SO THERE IS NO FIX D: nah jk theres a fix but idk it. goldstorm950 65 — 5y

Answer this question