How can disable the mouse wheel

So, I’m currently making a 2D game where I don’t need the W,S keys, the right-click button and the mouse wheel. I have managed to get rid of the first 3 but I’m still left with the mouse wheel. I need to disable the mouse wheel because I have a 2D camera script, that freezes the player zoom. Well not really the zoom, because this happens:

robloxapp-20230625-2110073.wmv (372.6 KB)

You can see here that the angle of the player remains frozen but the zooming does not. Which all together form an unwanted combination.

So here I am to ask you how to disable the mouse wheel?

ContextActionService doesn’t work because it only uses keyboard keys without the mouse.
I tried to make a function that returns nil whenever the player uses the wheel but still no success.

If someone has a possible solution tell me because I literally can’t continue building my game because of this.

For an alternative option, you could make the CameraMinimumZoom and CameraMaxZoom to whatever value besides 0.5.

1 Like

I can’t because as I’ve told you and as shown in the video my script makes the zooming possible but not changing the angle of it, the angle remains the same but it has the same effects on the player.

1 Like

Can someone help me please???

1 Like

local UserInputService = game:GetService(“UserInputService”)
UserInputService.MouseWheelEnabled = false

1 Like