Enable horizontal mouse wheel scrolling for ScrollView (with implementation code)

Currently ScrollView can only scroll content vertically using the mouse wheel, but cannot scroll horizontally with the mouse wheel. I want to add this functionality. The code modification needed is minimal, as shown in the image:

Hello! That should be true currently, with no vertical, the mouse wheel should scroll the horizontal content. And if there is a vertical scrollbar, shift + mouse wheel should target the horizontal scrollbar.

My fault! I forgot to test it on the latest Unity version.
Thank you!

1 Like