Can't detect mouse wheel with UserInputService

I’m trying to make something with utilizes the scroll wheel, in order to this I tried to detect on InputBegan, yet for some reason it doesn’t detect. I don’t feel like dealing with using mouse so I made this dev post

local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(I)
	if I.UserInputType == Enum.UserInputType.MouseWheel then
		print("WHEEL GOING " .. I.Position.Z ) -- this doesn't print
	end
end)

You need to listen to the InputChanged event instead:

local UIS = game:GetService("UserInputService")
UIS.InputChanged:Connect(function(I)
	if I.UserInputType == Enum.UserInputType.MouseWheel then
		print("WHEEL GOING " .. I.Position.Z ) -- this DOES print
	end
end)
3 Likes