Make scrolling move faster in scrollRect?

Currently when you scroll something in a scrollRect, by using the mouse, touch etc., it’s on a 1:1 basis.
Move the mouse 100 pixels, and the content is scrolled 100 pixels.

Is there a way to e.g. double this?
So when moving the mouse (or dragging when using touch) 100 pixels, the content is scrolled 200 pixels.
I guess I’m looking for a multiplier or something, but I don’t know where to find it, or how to achieve it.
Hope someone can help me :slight_smile:

Isn’t there a sensitivity in the scrollview prefab? Have you tried playing with that?

There is, but it’s got to do with sensitivity towards the start of scrolling, not scrolling speed itself.

Pretty sure scrolling speed is based on the User’s Scroll wheel setup via the machine’s system settings.

And on mobile? I want to be able to increase scroll speed on mobile, when touch-dragging to scroll.

Mobile is based on momentum, how quick the user flicks their finger.

I’m pretty sure it’s not. It seems to be 1:1 when I make something with scrollRect. Both in editor and live on devices.

You could look into this.

Pretty sure it is.

As I said above, scrollSensitivity has to do with sensitivity towards the start of scrolling, not scrolling speed itself. The manual is poorly worded.

There is a deceleration. Try decreasing that?

Again it’s scrolling speed when scrolling I’m after (when touching and scrolling) - not deceleration, which occurs after you’ve scrolled (released touch). There’s no deceleration occuring when you’re actively scrolling obviously.

So, normally when you scroll with your finger the user is “dragging” the window in the direction they’re moving their finger. It gives the illusion that they’re physically dragging the object. I implemented my own drag feature quite easily but my first iteration had the speed too high. Every pixel I moved my finger the object underneath moved 2. It was a really, really awkward feeling.

Basically, I don’t think you want what you’re asking for. Every app I’ve ever used, game or not, you just flicked the contents up really fast and let is scroll for a long time if you wanted to scroll quickly. Reduce the deceleration time so people can flick, call it good. :slight_smile: No one will think, “Golly I wish this was faster” except you, most likely.

Sorry to necro-post this thread, but I made a quick patch to the Unity ScrollRect to get faster-than-finger scrolling. It is AWESOME on mobile.

It is EXTREMELY useful when you have large images of content, and yet you want to quickly go through them without having to whip them along “ballistically.”

(This link updated 6:36 AM 3/13/2021, along with the line numbers below)

If you go to this file:

(This file is also available from the Unity Package Manager.)

Then you can download ScrollRect.cs and modify it to make your own that supports higher-than-finger scroll rates. Once you use it, every other scroll rate with 1:1 finger mapping (i.e., normal Apple / Android scroll rates) just feels glacially slow.

I recommend renaming the class and filename, such as “MyScrollRect.cs” and of course the internal MonoBehavior itself.

The first patch is about line 104 in the property declarations, add these two lines:

[SerializeField]
private float m_ScrollFactor = 1.0f;
public float scrollFactor { get { return m_ScrollFactor; } set { m_ScrollFactor = value; } }

The second patch is inside the OnDrag() method, approximately line 763 in the original file, AFTER the pointerDelta is calculated, but before it is used to calculate position:

var pointerDelta = localCursor - m_PointerStartLocalCursor;
pointerDelta *= m_ScrollFactor;    // this line is new!
Vector2 position = m_ContentStartPosition + pointerDelta;

Now you’re done. Use this newly-named ScrollRect anywhere you would use the Unity one and you can have faster-than-finger (or faster-than-mouse drag) scrolling. It’s awesome if I do say so myself!

22 Likes

@Kurt-Dekker Thank you very much! You saved my day, sir!

1 Like

@Kurt-Dekker Thanks! It really works!

1 Like

@Kurt-Dekker Your fix works like a charm. Thank you :slight_smile:

1 Like

@Kurt-Dekker Thank you. This is my change. Drop “ScrollRectFasterEditor.cs” in Editor folder and “ScrollRectFaster.cs” in Scripts folder

5022014–491939–ScrollRectFasterEditor.cs (8.17 KB)
5022014–491942–ScrollRectFaster.cs (31.1 KB)

1 Like

@Kurt-Dekker Thanks :slight_smile: still works like a charm.

1 Like

After I put in the modified script in my assets folder, How do I add the script to the gameobject, it says script not found?