Scrolling detection

Is there a way to detect when the mouse wheel has been scrolled up or down? I'm trying to create a camera script where the mouse wheel is scrolled to zoom in and out.

more ▼

asked Oct 31 '10 at 11:15 PM

Intensity116 gravatar image

39 7 8 10

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Try Input.GetAxis("Mouse ScrollWheel")

more ▼

answered Oct 31 '10 at 11:17 PM

StephanK gravatar image

6.4k 46 59 101

I don't have an axis named Mouse ScrollWheel.

Nov 02 '10 at 12:29 AM Intensity116

That is a standard axis that is predefined in Unity. If you somehow deleted it you can always setup your own axis in the InputManager (Edit->ProjectSettings->Input). Just set Type to MouseMovement and Axis to 3rd axis.

Nov 02 '10 at 07:26 AM StephanK
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Oct 31 '10 at 11:15 PM

Seen: 2225 times

Last Updated: Oct 31 '10 at 11:15 PM