I can detect when the wheel is being used by using UserInputService, like so:
uis.InputChanged:connect(function(input) if input.UserInputType == Enum.UserInputType.MouseWheel then print("WHEEL") end end)
The problem is that I cannot get the direction (forward or backward) that the mouse wheel is moving.
I have even tried using a ScrollingFrame with the MouseWheelForward and MouseWheelBackward events to detect when either of those things happen, but those events don't seem to fire.
Is there any other way I can detect the direction the mouse wheel is scrolling?
You're on the right track actually! You need to check the sign of the Z
component in the Position property of the inputobject!
uis.InputChanged:connect(function(input) if input.UserInputType == Enum.UserInputType.MouseWheel then print("WHEEL GOING " .. input.Position.Z > 0 and "UP" or "DOWN") end end)