- Home /
ScrollWheel Input not detected in script
Hi
I'm not getting any ScrollWheel input, so I attached this barebones script to the main camera to find the problem, but still don't get any scroll input reported.
function Update () { if (Input.GetAxis("Mouse ScrollWheel") != 0) { Debug.Log("Scroll"); }
if (Input.GetMouseButtonDown (0)) { Debug.Log("Left mouse button pressed!"); }
}
The button press is reported, so I know the script is attached and running OK, and has no compile errors.
The default ScrollWheel input is defined correctly in the Input Manager: Mouse ScrollWheel ... Mouse Movement 3rd axis
I'm on OSX 10.6, Unity 2.6.
Thanks for any clues
FourSheds
I'm using the latest Unity and still can't get any values out of "$$anonymous$$ouse ScrollWheel". This goes for my editor on the $$anonymous$$ac, and the web player on both $$anonymous$$ac and Windows Vista.
Answer by Cyb3rManiak · Sep 05, 2010 at 02:22 PM
Weird. Works fine when I run it here, so It's either your project's settings (Which seem to be fine as you describe them), or your mouse :)
Seriously, try opening a new empty Unity project and test it there. If it still won't work - try switching the mouse. Is it some kind of weird Evil-Coder-Macro-Do-It-All mouse with fancy drivers? Track pad? Standard mouse?
Thanks for the feedback, yes, it's an Evil multi-button cordless Logitech mouse with the latest drivers. So, as suggested, tried it with an Apple mouse and it works fine. Strange, the Logitech scroll works in every other application e.g. zoo$$anonymous$$g in Cinema4D.
Edit: Tried it with two other non-Apple standard 2-button mice (corded) and Unity will still only recognise the Apple mouse. Has anyone had success getting Unity to recognize any non-Apple mice?
Sorry for the delayed response... Yeah. I most certainly did. I never use an apple mouse, and even when I was coding with Unity on OSX I had no problem with using the scroll wheel. Back then it was Unity 2.1 and maybe 2.5, but I don't think it should matter.
Answer by FiveFingers · Nov 09, 2012 at 04:46 PM
The problem is with Safari on MacOSX. If you try same code on web player plugin with Firefox or Chrome on Mac, it works just fine.
I don't know why is that, and if there is some fix for Safari