- Home /
How To Enable and Disable ScrollRect?
Hello Guys,
I have a scroll rect with a vertical layout group for adding multiple objects. What I want to know is how to activate the scroll rect only when I add too many objects and they go outside the scroll view port.
For example, a max number of 4 objects fit into the viewport . While I have 4 or less objects I don't want to be able to scorll. The scroll should activate only when there are more than 4 and deactivate again if I delete some and the total number is again less or equal to 4.
I'd appreciate any help I can get.
Thanks, Alex
Answer by xxmariofer · Apr 24, 2019 at 11:54 AM
there is something i am missing, what do you mean by activate the scrollrect? have that "elastic effect"? since while your content(layour group) is inside the viewport it behaves as if the scrollrect "isnt active". can you try changing the movement type property in the scroll rect component to clamped¿