Disabling mouse wheel when ScrollView is scrolled

Hello everyone,

Basically, I have two scripts so that one (ScrollView.cs) is responsible for ScrollView and other(CameraControl.cs) is for zooming by using mouse wheel.

Zooming codes are in LateUpdate.
Scrolling codes are in OnGUI.

The problem is obvious, I do not want to zoom in-out when user is scrolling the ScrollView.

I also tried the changing order of script execution. But nevermind, I do not know why but it did not work.

Thanks in advance.

What you may be able to do is detect if the mouse is over top of your scroll view. If the mouse is over the scroll view, and the user is scrolling, then disable scrolling in your other script.

You can detect if the mouse is over your scroll view by using the Rect.Contains function and give it the Rect of your scroll view, and the mouse coordinates.
The following doc may help you:

Good luck!