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

How do I detect mouse movement with UserInputService?

Asked by 8 years ago

I had assumed It would be a part of InputBegan like:

uis = game:GetService("UserInputService")
uis.InputBegan:connect(function(input)
    local inputType = input.UserInputType
    print("Input: ", inputType)
    if inputType == Enum.UserInputType.MouseMovement" then
        print("Mouse moved")
    end
end)

but UserInputType is never the MouseMovement Enum. Anything wrong here?

Answer this question