Collapse Sidebar


The WheelBackward event fires when a user scrolls their mouse wheel back when the mouse is over a GuiObject|GUI element. It is similar to Mouse/WheelBackward, which fires regardless whether the user’s mouse is over a GUI element.

This event fires merely as an indicator of the wheel’s forward movement. This means that the x and y mouse coordinate arguments do not change as a result of this event. These coordinates only change when the mouse moves, which can be tracked by the GuiObject/MouseMoved event.

See also

  • GuiObject/MouseEnter
  • GuiObject/MouseLeave
  • GuiObject/MouseMoved
  • GuiObject/MouseWheelForward


Name Type Default Description



The mouse’s x screen coordinate in pixels, relative to the top left corner of the screen



The mouse’s y screen coordinate in pixels, relative to the top left corner of the screen

Code Samples

Custom Scrolling GUI

The example below creates a custom scrolling frame using a Frame to mimic a ScrollingFrame using the GuiObject/MouseWheelForward and GuiObject/MouseWheelBackward.

The example works by moving a Frame that is the child of our CustomScrollingFrame and parent to the TextBox|TextBoxes. Thus, we use a Frame to act as a container for the GUI elements we want to scroll. The script adjust’s the DataType/UDim2 Y scale position of the Frame between 0 and -1 when the user scroll’s their mouse forward and backward to mimic the scrolling of a traditional ScrollingFrame element.

Although this is a simple application of the MouseWheel events, it can be expanded upon for more complex GuiObject|GUI layouts and interaction such as custom ScrollingFrames that scroll at different rates or with different elasticity.

The gif below demonstrates the expected functionality of the code based on the GUI layout also shown below.

Code sample demonstration

GUI Layout in Studio Explorer Window