I’m trying to make it so if the player hovers over a TextLabel then it shows a little information thingy about that. Here is the part of the script I’m having a problem with, although I’m pretty sure it’s not in here.
for _, frame in ipairs(frames) do
frame.MouseEnter:Connect(function()
infobox.Visible = true
infobox.Text = frame.Text
rs.RenderStepped:Connect(function()
for _, poop in ipairs(frames) do
local m = uis:GetMouseLocation()
infobox.Position = UDim2.fromOffset(m.X,m.Y)
end
end)
end)
frame.MouseLeave:Connect(function()
infobox.Visible = false
end)
end
I want it to be above the mouse by a bit but I’ve been working on this for the past 30 minutes when it shouldn’t take this long for something this easy. Maybe I missed something idk. Help please !!!
In case you’re still having problem with this heres what I think you need to do:
set the AnchorPoint of the frame / textlabel you want to follow your cursor to [0,1] this puts the anchor at the bottom left corner of the label where your mouse is gonna be
in my case I named its named “FollowMouse”
this by itself should solve your problem
incase you want to change its position relative to the mouse just add to the offset m.X + offset or m.Y + offset. Hope this helps
could you please screenshot your whole screen so we know exactly everything thats on it?
also please give more information about the properties of the infobox, because it should not look like that unless an offset of somekind is already added to the infobox making it position so weirdly.
Ok, I think I found the issue. If i set the infobox to a different parent, like my main frame of things if that makes sense. Only reason I think it could be doing this is because I have my frames set up like this:
ScreenGui > Screen (Frame, AnchorPoint = 0.5)> Options (Frame, AnchorPoint = 1)> MainFrame (Frame, AnchorPoint = 1)> where the infobox was originally.