I want to make this hover effect disappear after the mouse leaves and i also want it work both on PC/Mobile, how would i do this?
local Preview = script.Parent.Parent:WaitForChild("Preview")
for Object, Frame in pairs(script.Parent:GetChildren()) do
if Frame:IsA("Frame") then
Frame.MouseMoved:connect(function(x, y)
Frame:TweenSize(UDim2.new(0.85, 0,1.2468, 0),"Out","Sine",0.15)
Preview.Position = UDim2.new(0, x, 0, y)+UDim2.new(0, 15,0, -5)
Preview.Text = Frame.Name
Preview.Visible = true
end)
end
end
For updating the position of the mouse you can continue using .MouseMoved(). The events that I’ve suggested are just for detecting whether the mouse is over the frame or not. So if you’d like the effect to disappear, then use .MouseLeave() to know when the player is no longer hovering over the frame.