How to read the mouse inputs (and work in first person)

I cannot find a solution for this that doesnt use mouse.move or contextService:BindAction(“CameraMovement”) when neither of these work for my situation. i want to read the mouse’s movements while the mouse is locked

1 Like

What do you mean by “reading the mouse’s movement”?

Mouse moved left = print(‘went left’)
bro its that simple

If you need to track mouse movement, you can utilize the UserInputService’s InputChanged event:

UserInputService.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement then
        local delta = input.Delta

        -- Negative X is left and positive X is right.
        if delta.X > 0 then
            print("Mouse moved right")
        end
    end
end)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.