Scroll Rect - Invert scroll direction of ScrollRect for mousewheel but not click-drag???

So I want very simple behavior for Scroll Rect - when you click and drag down, it should scroll down.

The default behavior is the opposite: when you click and drag down, it scrolls up.

Similarly, when you mouse-wheel down, the default behavior is to scroll up.

I want to invert this behavior. It seems the way to do this is to set the ‘scroll sensitivity’ variable on the Scroll Rect to a negative number. When you do this, it does indeed invert the behavior for the mouse-wheel, but it does not invert it for click-drag functionality. With a value of ‘-10’, click-dragging downards will still scroll up, whereas mouse-wheelling down behavior is successfully inverted; it will scroll downward.

Looking at the Scroll Rect API, it does not appear there is any other way to invert the click-drag behavior.

This doesn’t seem to be a bug as I’ve checked a previous versions of unity and it works this way (2019.3).So how do I go about inverting click-drag scroll direction? Feels like there should be a simple solution and I’m missing it.

I can find the scroll rect source on github and add the inversion, but that seems like it should be unnecessary.

1 Like

Same issue here in 2019.4.10f1

Hey, found the issue:

If the scrollbar is over the viewport, the scrollbar must be BELOW the Viewport in the hierarchy.

If it above it is still visible, but the raycast target no longer registers, so you think you’re dragging the scrollbar, but you’re in fact dragging the viewport and it drags the other way than the scrollbar.

Right:
6365166--708318--upload_2020-9-30_12-0-46.png

Wrong:
6365166--708321--upload_2020-9-30_12-0-59.png

5 Likes

Thanks, you just saved me!

thank buddy this is help full

This message from a decade ago deserves the highest honors.