So this is pretty simple, but I’m not very familiar with it. I have a gui and I want a textlabel to appear when a player hovers over a frame. I want the textlabel’s position to be the mouse’s position for as long as the mouse is in the frame, but then when the mouse leaves the frame, I want it’s visible to be set to false. I have a local script inside of my frame, and there are no errors, but for some reason the textlabel isn’t showing up at the mouse’s position. When I tried to print out when it entered and left, it printed out fine though. Here’s the local script inside of the frame:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local ui = script.Parent
local text = ui.UIName
ui.MouseEnter:Connect(function()
text.Position = UDim2.new(mouse.X, 0, mouse.Y, 0)
text.Visible = true
end)
ui.MouseLeave:Connect(function()
text.Visible = false
text.Position = UDim2.new(0, 0, 0.5, 0)
end)