Search code examples
buttonunity-game-engineuiscrollviewscrollrect

Unity - Scroll Rect?


I have this problem. I'm using a scroll rect to display a series of buttons, but I would make sure that as soon as the buttons (with the scroll rect), come out of a certain area (bounded by a panel), become invisible. to explain it better in the pictures. I would like the visible part of the list of buttons to stop where there is the black arrow, and then I would delete the part where I drew the red waves

enter image description here

enter image description here


Solution

  • You need to use UI Mask to hide the elements when they are out of parent's bounds. Here's a good tutorial about it.