Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I check if the player's mouse is hovering over a frame?

Asked by 2 years ago

Any answers are much appreciated but please leave a scripting example and talk through how the script works if its not too much work. Thanks in advance.

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

You can use the Frame.MouseEnter and Frame.MouseLeave along with a variable to do so

Heres an example:

local Hovering = false
local Frame = Script.Parent -- Frame location here

Frame.MouseEnter:Connect(function()
Hovering = true
end)

Frame.MouseLeave:Connect(function()
Hovering = false
end)
Ad

Answer this question