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)