How would i detect a mouse is over a gui?

Just wondering how would i detect if the players mouse is hovering over a gui,
Is there a way to do this or would i need to define a gui’s area or something?

1 Like

You can use the MouseEnter event on gui instances for that. GuiObject.MouseEnter

As well as this BasePlayerGui:GetGuiObjectsAtPosition

1 Like

The easiest answer I would give is using the MouseEnter event

I would do this, but with what im trying to do wont work with MouseEnter im pretty sure

Hmm this seems like a option, ill check it out

script.Parent.MouseEnter:Connect(function()
    print("Hello world!")
end)

script.Parent.MouseLeave:Connect(function()
    print("Goodbye world!")
end

The 2nd prjnt got kinda dark- Anyway, that’s how you’d do it! :grin:

8 Likes