# Unity MouseWheel weapon change

I am trying to make a simple weapon change in Unity3D. The best way to do this is with the mouse scroll wheel, as far as I can see.

I googled on how to do this and found that I have to use Input.GetAxis("Mouse ScrollWheel"); I use this piece of code and print it. Still, I always get an value of 0. any ideas? I just need to solve how to get the value first, I'll figure out the rest myself.

Code idea:

function Update () {
print(WeaponNumber);

if(Input.GetAxis("Mouse ScrollWheel")){
WeaponNumber += Input.GetAxis("Mouse ScrollWheel");
}
}


## 1 Answer

In addition to using the code you have above you need to configure the axis in the input manager and name it correctly.

The accepted answer here may be of help: http://answers.unity3d.com/questions/6106/implementing-the-scrollwheel

• @BallzOfSteel, if you are satisfied with an answer, please click the accept answer button. – AttackingHobo Apr 27 '11 at 16:57