PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

WheelForward

The WheelForward event fires when the mouse wheel is scrolled forwards. Possible uses for this event include toggling a gun’s scope in a first person shooter (FPS) or zooming the player’s camera.

This can be used alongside the scrolling backward event, Mouse/WheelBackward.

For information on how to obtain the Mouse object, please see the Mouse page.

Note, developers are recommended to use UserInputService instead of the Mouse object in new work.


Code Samples


Mouse.WheelForward

The below example assumes that you have already got the player’s mouse (and set it as a variable named ‘mouse’), whether by use of a Tool, HopperBin or the /Player/GetMouse method. It will print “Wheel went forward!” when the player scrolls forwards.