- Home /
Input.GetAxisRaw("Mouse ScrollWheel") 4 times
I noticed that
Input.GetAxisRaw("Mouse ScrollWheel")
stays "active" for 4 frames. It keeps returning 0.1 for 4 frames even though I only rotated the mouse wheel once. How to prevent this from happening?
Comment
I tried to reproduce the problem and failed, which hints that it is a hardware issue rather than a Unity issue. $$anonymous$$y test:
var f : float = Input.GetAxisRaw("$$anonymous$$ouse ScrollWheel");
if (f != 0.0) {
Debug.Log(f+", "+Time.frameCount);
}
You might try increasing the dead zone for this axis to see if it fixedsthe problem. You can also code around the issue since $$anonymous$$ouse ScrollWheel returns 1.0:
var f : float = Input.GetAxisRaw("$$anonymous$$ouse ScrollWheel");
if (f > 0.5 || f < -0.5) {
// Take action here
}