- Home /
How to disable mouse wheel scroll inside a scrollview?
Hello,
I'm pretty new to Unity and coding in general. I would like to disable the mouse wheel automatic scrolling when in my scrollview. I have looked for this all over the web and can't seem to find an answer.
I have created a mousedown + mouseposition tracking to update the scrollview Vector2D (which control the position of my scrollview content). This allows me to "drag" the content around. Unfortunately when I use the scroll wheel of the mouse it also updates the Vector2D and consequently moves the content inside.
I tried preventing this by constantly updating the Vector2D, but everytime I scroll with the mouse wheel, you can see 1 frame of scrolling which is definitely not what I am looking for.
Is there any way to prevent the mouse wheel to scroll inside my scrollview? Am I thinking this the wrong way?
Thanks!
Sadly this is not helping. This is in the case of having 2 different scripts, doing 2 different things.
When the content of the scrollview is bigger than the rectangle it is inside, the scrollwheel of your mouse will automatically scroll the content. This is what I need to prevent while maintaining all the other controls, and I cannot do this by disabling the script.
Answer by Eldoir · Jan 08, 2018 at 10:48 PM
Hello there, I know this is old but I couldn't find many answers about this, and I finally figured out myself a very simple solution. Just set the "Scroll Sensitivity" field of your Scroll Rect script to 0 (image below). Cheers!
Your answer
Follow this Question
Related Questions
Scrollview is positioning things incorrectly 1 Answer
How can I programmatically tween a Scroll View to a desired position? 0 Answers
Scroll view using Mesh 2 Answers
[Solved] need help regarding autolayout in scrollrect 1 Answer
Nested Scroll Views: How can I pass drag control from an inner scroll view to its outer scroll view? 2 Answers