How can I know exactly when the scrolling reach to its both ends? I am using a horizontal scroll and I though I can give a trigger depend on the scroll content’s position but it was not work out. Can anyone help me??
I tried call this from Scroll Rect On Value Change and On Drag End. But does not work.
public void OnDragScroll()
Don’t expect the value of ScrollRect to be exactly something, ScrollRect might stop scrolling, and it’s value might be 0.01… or 0.98 for example.
So the position won’t equal something, it’s either less or more than something.
So try this to check if your Scroll Rect is at the end part of scrolling:
if (scrollRect.verticalNormalizedPosition >= 0.95f) // scrolled near end
And to check beginning part of Scroll Rect:
else if (scrollRect.verticalNormalizedPosition <= 0.05f) // scrolled near start
I think you should definitely call it from ScrollRect.onValueChanged listener, as dragging might end way before scrolling of content stops… I think.
"Yap, also tried the verticalNormalizedPosition. When I use that, it does not give exact answer. It is keep changing 1 and 0. "
It’s a float value, and it goes from 0-1.
What is leftArrowOverLay and rightArrowOverLay mean?Am new to the unity.,What does the leftArrowOverLay and rightArrowOverLay? Am very new to unity. If my question looks very stupid pardon me. @eses
To detect the scroll has reached the end is ok but when it comes to like I have 4 scroll rect in my project and they are aligned like one is parent scrollrect and others are there chid of that parent scroll but the problem is that after the first scroll child go to the last position it do not go to the second child of the parent scroll. What can I do to achieve that?? Is there any method that I can call to activate the parent scroll which will go to the Second child of the parent scroll and Vise-versa???