UI ScrollRect inertia does not work between 35-50%
I've spent the last few hours optimising an image search results screen within my companies app and have encountered bug with Unity's ScrollRect component.
Steps to reproduce:
Create a vertical scroll view with a content area 6000 or taller
Turn on inertia
Start the app/game
Scroll to 35% of the content at which point inertia stops working
Once you reach 50% inertia starts working correctly again
The greater the height of the content panel and/or larger deceleration rate the more noticeable it is.
This happens when running within the editor and on my Android phone (haven't had a chance to test on iOS yet).
I'm using Unity 5.4 but this was also happening with a previous 5.3 build.
One additional thing I've just noticed, when the scroll view first reaches 35% of the content the following error appears a few seconds later in the debug console:
IsFinite (m_CachedRange.first) && IsFinite (m_CachedRange.second)
I spotted this error a few days ago and didn't know what was causing it - I found a thread on this forum suggesting it is an issue with custom animations but this is being caused by the above issue.
This might be a question, so I sent it through, but there's an official Unity bug reporter that maybe is where you really want to send this?
Thanks Owen, I did actually want to report this as an issue but I couldn't see any way to post it to the issue tracker from this website.
I feel really stupid, just found the "Report a Bug..." dialog in the editor. doh!
Answer by pineda100 · Feb 16, 2017 at 04:30 PM
Same issue is observed.
Here's a pastebin of a script i wrote to manually use scrollbars.
Note that the issue is not observed when scrollbars are not assigned to scrollrect. This is a Script to workaround the issue temporarily, by not assigning the scrollbar to the scroll rect, But to update the scrollbar functionality manually.
@pineda100 Oh wow thank you so much! It worked perfectly. I was so sad, I have this page of over a thousand names so the scrollbars are necessary. The Unity scroller just has no inertia for the top 15% of the page on my Google Pixel 2. I used your fix and now the inertia is back! And this is 2017.3 so the bug is still there.
Answer by r2digi · Sep 06, 2016 at 08:11 PM
i think there's a bug with the scrollbars. for us we removed the scrollbars and the scrolling is smooth again.
I've been having the same issue and removing the scrollbars worked for me as well.
Answer by reddtoric · Dec 08, 2017 at 05:42 AM
Issue still exists in version 2017.2.0f3. Taking scroll bar off works.
Answer by JanusAnderson · Oct 01, 2016 at 07:15 PM
Has anyone found a workaround for this that doesn't involve getting rid of the scrollbar? This does indeed solve the problem but I need scrollbars in my game. I haven't been able to update Unity since 5.3.5 because of this bug being introduced and I can't figure out a way to solve it.
i'd just try rolling your own scroll bar. shouldn't be that hard.
I ended up rolling back to 5.3.2f1 and I haven't had any issues. This will work for my current project but I'd like to use the latest for my next one hopefully they fix it.
I actually built a example project and sent it in with a bug report. They responded that they knew about the bug and it 'was fixed' but didn't know when the fix would be released :/
I just downloaded 5.4.2p2 and still no fix... back to 5.3.5 I guess.