How can I detect when the players starts and stops moving their mouse?

This is the only way I think I can do it but is there a better way?

runService.RenderStepped:Connect(function()
	
	local magnitude = (camera.CFrame.LookVector - lastLookVector).magnitude
	
	
	lastLookVector = camera.CFrame.LookVector
end)
local moving = false
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local run = game:GetService("RunService")

mouse.Move:Connect(function()
  moving = true
end)

mouse.IdleConnect(function()
  moving = false
end)

run.RenderStepped:Connect(function()
  if moving then
     print("Moving")
  else
      print("Idle")
  end
end)
1 Like

Is there a API refrence about mouse.Move you could link me to?

1 Like

mouse.Idle:Connect , just in case somebody was thinking why it didnt work

1 Like