I've got a Scrollbar with a dynamically generated number of entries, and I'm trying to figure out how to get it to act so that there's a lead-in of the first 3 items (example number based on the size of my scroll area) where the area won't move. This then leaves the current selected item as the one in the centre of the area, and the content should move up so that the selection remains in the centre until the last 3 are visible, when the selection continues down to the bottom.
My efforts so far have varied from calculate the percentage through the content (currentSelected / numItems) & assign the scrollbar.value, to putting that percentage through an AnimationCurve, which gives me the "dead zones" at the beginning & end, but introduces unpleasant skipping & doesn't centre the selected item.
Also, this is intended to be for navigating through discrete objects using a gamepad.