I'm outputting Labels and Buttons to a ScrollContainer from a script.
The structure is:
ScrollContainer
.... VBoxContainer
.... .... VBoxContainer
.... .... GridContainer
Everything works properly, except that I want to automatically scroll down when items are output so that the last added items are visible.
I read that the way to do this is:
$ScrollContainer.scroll_vertical = int($ScrollContainer.get_v_scrollbar().max_value)
But it doesn't work. Manual scrolling is required to scroll down.
I've tried some variations, but can't change the vertical scroll position from the script.
I've tried adding $ScrollContainer.update()
after the statement above, and in the _process() function, but it didn't help.
Any ideas?