Is there a way to check the middle mouse button scrolling up or down I know you can use mouse button 1 for left and mouse button 2 for right but mouse button 3 in code does not work, is there another way?
Yes, in Mouse
, there are two events that will help you, WheelBackward
and WheelForward
.
However, you could also use the new UserInputService
's methods like InputBegan
. From there, you could check if UserInputType
is UserInputType.MouseWheel
. I suggest the former method, but who knows how long until Mouse is depreciated in favor of mobile-friendly input?
local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.WheelForward:connect(function(plr) print("Wheel Forward") end)
Edit: I did not see this post was old