Unity Scroll Wheel Bug?

I’m creating a tool and I want the user to be able to scale an item while working with it. To do that I want to put in the Update method a check for scroll wheel input. I’ve been doing some reading and others seem to have had the same issue before.

Edit: II found the solution. EditorWindows cannot use the Input class. Instead you need to manage your input with the Event.current mechanism. Works fine if you do that.

	void Update()
	{
		float deltaScroll = 0.0f;
		
		if(texture != null)
		{
			deltaScroll = Input.GetAxis("Mouse ScrollWheel");
			Debug.Log("Delta:  " + deltaScroll);
		}
		
		if(deltaScroll != 0.0f)
		{
			TextureScale += deltaScroll;
		}
	}

deltaScroll is always equal to zero.

“Mouse ScrollWheel” is defined in my input manager s shown here (I’ve tried other options though to no avail)

Try setting the Type option to “Mouse Movement” instead of “Joystick Axis”?

No, I’ve attempted that option. I’ve tried two different mice and neither worked. I know the scroll works because the Unity editor recognizes it for scaling in the scene view. Just my script can’t get values for whatever reason.

LET IT LIVE AGAIN!

I have the exact problem now, 4.5 series.

No matter what mouse, or setting, the delta is always zero.

Yet the mice work fine in Unity Editor and elsewhere.

I can’t seem to find much on this issue since your post, so I assume it to be an intermittent thing.

Or were you ever able to fix/get it working?

From the first post: