While working with a inventory dragging system, I’m trying to detect when the mouse button 1 is down. But while hovering over a GUI element it stops working.
Code:
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local MouseDown = false
Mouse.Button1Down:Connect(function()
MouseDown = true
print("Mouse down")
end)
Mouse.Button1Up:Connect(function()
MouseDown = false
print("Mouse up")
end)
In the video, I demonstrate my problem. When I hover over the GUI I do hold down my mouse button 1.