Scrollbar starting centred

If I change the number of inventory slots to say 100, the scroll bar starts in the middle of the sliding area, rather than the top.

I have tried playing with the “Value” on scrollbar, which the docs indicate is the initial position of the scrollbar, but this doesn’t appear to make a difference.

Have I missed something?

I’ve gotten the exact same behavior.

Hmm… after playing around with this for a while, I think I have the solution: In InventoryUI, make a SerializedField for the Scrollbar and attach it in the InventoryUI in the prefab. Then, at the end of the Redraw() method, add this line:

scrollBar.value = 1;

That seems to have worked, thanks!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms