This has been an issue for me for quite some time now. Initially, I was unsure if this was ROBLOX's fault or my fault. But after waiting this long I'm just not sure anymore...
Here's a seemingly viable example of checking for mouse movement with UserInputService
. I'm not sure if I'm missing something here, or if this has just been a thing with ROBLOX forever:
local inputService = game:GetService("UserInputService") inputService.InputBegan:connect(function(input) print(input) -- Not even the MouseMovement input type shows. end)
Nothing prints when the mouse is moved. I feel like I'm probably just missing something, but at the same time I see nothing wrong with this, for there's a UserInputType called MouseMovement
. So, if anyone has any insight on this I'd appreciate it.
It also doesn't detect any of the following UserInputTypes (including MouseMovement):
MouseWheel
TextInput
The users mouse is a constant event so it will not end / have an end state.
You are able to use the 'InputChanged' event to find when the mouse is moved:-
local inputService = game:GetService("UserInputService") local mouse = game.Players.LocalPlayer:GetMouse() inputService.InputChanged:connect(function(input) print('inServ', input.UserInputType, input.Position,'mouse' ,mouse.X, mouse.Y) end)
Hope this helps
I found that both MouseMovement
and MouseWheel
can be detected using InputChanged
rather than InputBegan
. I'm not sure about TextInput
however.
Locked by JesseSong
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?