Mouse hovering over GUI button

Heyo…


I’ve got this:
image
image

As the above look like i have this “Description” type when hovering over a ImageButton.
And yes as the above shows, It works. Although i found it’s not at all reliable.


When moving the mouse hover multiple items fast. It stops showing the “Description” Frame.

The Script
  • Note: Hovering is a variable within the function. Not sure if this is important to know.
local function Hovering(Image)
	RunService.RenderStepped:Connect(function()
		if IsHovering then
			Desc.Visible = true
			Desc.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
			
		elseif not IsHovering then
			Desc.Visible = false
			return
		end
	end)
end
for i,v in pairs(InvFrame:GetChildren()) do
	if v.ClassName == "ImageButton" then
		v.MouseEnter:Connect(function()
			IsHovering = true
			
			Desc_Name.Text = v.Name
			
			DescFrame.ImageColor3 = Module_Rarity[Module_PetData[v.Name].Rarity].FrameColor
			Desc_Rarity.Text = Module_PetData[v.Name].Rarity
			Desc_Rarity.TextColor3 = Module_Rarity[Module_PetData[v.Name].Rarity].TextColor
			
			Hovering(v)
		end)
		v.MouseLeave:Connect(function()
			IsHovering = false
			Hovering(v)
		end)
	end
end

I’m hoping that someone could help solve this. Since i don’t want this keep happening.

Thanks.

3 Likes

Try taking a look at this, just a quick search

Hope it helps!
Let me know!

3 Likes

Omg you’re a life saver.

Works so well and smooth… ;-;
I needed this in my life sooo badly how did i not find this sooner?!

4 Likes