simple-scroll-snap
simple-scroll-snap copied to clipboard
Excess snapping animation to Starting Panel with no 'Use Automatic Layout'
In case of using non automatic scroll-snap layout there is a problem with excess animation lerp to the first panel.
These lines in Setup can fix this behaviour:
private void Setup()
{
...
// Starting Panel
...
Vector2 targetPosition = -Panels[CenteredPanel].anchoredPosition + offset;
Content.anchoredPosition = targetPosition;
// Buttons
...
}
Or may be you can consider another solution.
Oh, I've made a mistake, there is already start Content.anchoredPosition calcualtion.
The problem is Setup() is calling from Start() which execute before Unity Layout system calculate new correct positions for layout elements.
Possible solution is move Setup() method at the very first Update() call...