Relative Content

Tag Archive for unity-game-engineunity-ui

Simulated drag event is not scrolling Scroll View correctly

I have a custom UI element that acts like a Scroll View. In the unity emulator I can drag the element up and down and it scrolls through a list of child elements. I want the list to have an initial scroll when the scene starts to show that it can be scrolled. Using the below script I tried to get this auto-scrolling effect by simulating drag event on the UI element as if I was scrolling it myself. Instead, it immediately shifts what appears to be a bit downward, then stops. I can’t seem to find the issue.