Creating tooltips?

So I’m attempting to detect when a player hovers over certain frame’s parent (eg; if were to use mouse.Target on a part, I’d detect it via if mouse.Target.Parent == ‘Name of parent’)

Is there a way for this to be done or would it be more efficient using another method?

The directory for the inventory system i’m using goes as;
https://gyazo.com/aab87804bb84c89702285967a0dbb2c7

Cheers for any help.

1 Like

There is an event which is fired when you move your mouse over a frame: Frame.MouseEnter. You can connect to it and make it show the tooltip, then use Frame.MouseLeave to hide it (note that this event sometimes doesn’t fire, particularly when you move your mouse very fast).

An example usage:

for i,v in pairs(InventoryFrame:GetChildren()) do
    v.MouseEnter:Connect(function()
        v.Tooltip.Visible = true --i don't know where are the tooltips in your screenshot so change this accordingly
    end)
    v.MouseLeave:Connect(function()
        v.Tooltip.Visible = false
    end)
end
5 Likes

Tooltips usually appear after hovering the same spot for a short while. If OP is fine with having the tooltip appear instantly, Kiriot22’s solution works perfectly fine. If not, here’s a much more complicated solution I made not long ago. I think it covers most edge cases, but I haven’t bothered to implement line wrapping for very long messages yet. The offsets also don’t work perfectly on all resolutions, and it doesn’t have any checks to make sure tooltips don’t appear under Core Guis.

Oh, and in case the instructions on the model page aren’t clear enough, here’s an example place:
https://www.roblox.com/games/3191248386/Tooltip-Example-Place

1 Like

Problem is with both of them, they only show up when hovering over for the first time, they do not update so they can appear clunky.

How would you want it to “update”?

https://gyazo.com/bcc758779c0915d65c874f71e57fa6f3

1 Like