So I have a scroll rect with an image and a mask and I can drag it with the mouse fine but how can I scroll with the mouse wheel?
I can add a scrollbar and again can drag that with the mouse but theres no scroll wheel functionality by default.
I tried adding an event trigger and changing the scrollbar value but can only set it to one value…
Surely it should be pretty simple?
There is an event for the scroll wheel, actually: IScrollHandler, with its OnScroll() event. It shows up in EventTrigger as “Scroll”. Note that this is another case of the event data being a bit funky again, so it needs to be recast. Putting this method in a class called from EventTrigger works:
public void Scrolling(BaseEventData data)
PointerEventData ped = (PointerEventData)data;
The y vector is the regular (vertical) scroll wheel. Positive is up. If you have a mouse with a secondary (horizontal) wheel it should show up as the x vector, but some of those mice can have the two swapped.
I couldnt get this working properly but didn’t try very hard as I was expecting it to be fixed by unity which it is now in beta release 19