- Home /
Scroll Rect - Scrolling Limit
I have a how to play panel that the user can scroll through. The panel includes images and text. I have my scroll rect settings on unrestricted. I have tried the other setting including clamped and elastic. Elastic does not let me scroll very far (as seen in the video below) and clamped restricts any movement at all. With the unrestricted setting the user is able to scroll forever which does not look good in a final product. How can I make a scrolling constraint at the top and bottom of the panel?
I posted this video for another issue I was having (which is solved), but you can see my setup - https://www.youtube.com/watch?v=fKTfC7nGEP0
Thanks for getting back to me again! I have watched this tutorial. I have tried switching the movement type before I posted, but continued to run into this problem (https://youtu.be/WJ8qtlatsso). Setting the movement type to unrestricted allowed it to move the way I wanted, but now I can't get it to stop when the player reaches the end. Do I need to make all the sprites and text into one image?
And what about "clamped" movement type? does it work?
Clamped does not allow it to move at all. I do not have a content fitter, but if I tried to add it to the panel, and expand, it does not work.
Answer by DistulX2 · Apr 23, 2017 at 11:40 AM
I know this is a bit of an older post and that you've probably figured it out by now.
Problem: Clamped Movement Type doesn't scroll. Elastic Movement Type only scrolls to top.
Solution: Within the Content Size Fitter, set the axis you're scrolling on to Preferred size.
Thanks for providing an actual answer to the question ins$$anonymous$$d of a snarky remark about reading the tutorials like the other comment.
Just a followup:
I am creating Photon network video tutorials, but the first video covers scrollview component and adding items.
Thanks to give a solution ins$$anonymous$$d of giving a link to documentation
Answer by VodkaFR · Aug 23, 2017 at 03:48 PM
I have encountered today a similar problem.
If the elastic mode acts like unrestricted and clamp doesn't allow you to scroll. It's probably because you have setup the viewpor of the scrollRect to the wrong GameObject.
Since it took me hours to find out and I kept finding this post I post here the answer of my problem.
Answer by wojtask12 · Jun 14, 2016 at 08:43 PM
Oh come on. You should go through official manual/learn section/documentation BEFORE asking here. Believe me, you're gonna learn many valuable things there! https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-scroll-rect it's covered at 2:30, but i highly reccomend you watching the whole video, and thengo through all the /learn/tutorials section.
Watching this tutorial gave me the knowledge to solve this problem! Thank you for posting the link @wojtask12. Now I understand how to add an Image (Script) component in combination with a $$anonymous$$ask (Script) component to effectively limit the scrolling of my view-port to whatever the mask can see. It's perfect!
And the problem you were having is different to the problem described by the OP. Your issue related to the Rect Mask, while this issue relates to the clamping or not of the Scroll Rect object.
You're advice is correct, but it's the wrong advice in this instance, since even if you follow all steps, you do not always arrive to the correct clamp behaviour when using these components. I watched the 'whole' video, and the problem the OP describes is not covered.
Answer by Lumpazy · Dec 04, 2020 at 01:45 PM
How it works and how it should work may not always be the same : After having used unity for over 2 Years and Scroll rects etc all implemented quite often with very different demands i still run into troubles like these !!
This time : The solution was to add a horizontal layout group (for horizontal scrolling) on the content. The problem seems to be that the scroll rect does not get the correct values from the content size fitter without the layout group ??? I do not remember what the tutorial has to say about this, but it does seem all weird. Somehow the logic of it all still eludes me, which means the components often do not behave like one would assume from the tutorials or the manual.
Answer by CringeItIn · May 26, 2021 at 04:52 PM
For me personally, the key was to understand that the content has to be larger than the root (viewport) Then, the desired effect could be achieved:) Hope this helps someone!
Your answer

Follow this Question
Related Questions
How can I set the mousewheel scroll speed in a ScrollView? 3 Answers
Making the camera zoom in and out? 1 Answer
Scrolling Text 1 Answer
Touchscript drag constraints 1 Answer