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?
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
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.