How can you loop a ScrollContainer?

Version: 4.4.1

I’m new to gamedev, have been fiddling around with control nodes, and was wondering if it is possible to loop a ScrollContainer so that when you scroll vertically down to the end of its contents, the ScrollContainer essentially restarts or loops back to the top and so on without a visually apparent jump.

I’m aware a potential workaround would be to have the contents of the ScrollContainer jump to the top once out of view/at the end of the container, but I ask since I couldn’t find information in the documentation or online and just in case anyone is more aware/had a similar issue.

1 Like

This is called a carousel menu and usually they are horizontal, not vertical. I don’t think there’s a built in implementation of this kind of menu, but you’re right that you can fake it by changing the scroll container’s scroll progress to the top when it reaches the bottom.

Gotcha! I’ll be sure to look up ‘carousel menu’. Thank you for mentioning that.

I’m aware this is not natively implemented though hope someone has an idea about it.

1 Like

You can also make your own custom containers by extending the container node. Maybe you could make your own custom InfiniteScrollContainer that teleports elements whenever the user scrolls too far? It would give you more control than a ScrollContainer that goes back to the top / bottom.

1 Like

Something to that effect is essentially what I am hoping someone had insight on since I am still very much a novice and not sure if I should try making a custom one since I barely understand the current nodes. Right now I am testing if I can achieve that teleporting effect by using global positions of the VBox’s child nodes in relation to the ScrollContainer to see if I can reorder things as necessary.