- Home /
Scroll Rect Min/Max Size
I'm trying to create a scroll rect that automatically scales to fit its content but prevents it from scaling past a maximum height.
When there is only a few buttons it fits to the content size so there is not a huge empty space in the scroll rect.
But if there is too many buttons, it will prevent the scroll rect from going past a max height and stop it from filling the entire screen.
I've tried just about every combination of Content Size Fitters and Layout Groups but they all prevented the scroll bar from working or breaks the layout. Any help on this would be greatly appreciated. Thank you.
I doubt unity has such a functionality, you will need to control the scroll rect size manually by code and once it reaches the desired size use a vertical layout and a content size filter so that it starts filling automatically