- Home /
Question by
Haoming-Michael · May 31, 2018 at 12:45 PM ·
inputshiftmousewheel
Shift + ScrollWheel
Input.GetAxis("Mouse ScrollWheel") isn't working when holding Shift. Anyway to fix it? Which means you can't Change Weapon when Running in a FPS game...
Comment
Answer by hawksandwichgames · May 31, 2018 at 12:59 PM
All three of these worked for me:
if (Input.GetAxis("Mouse ScrollWheel") != 0 && Input.GetKey(KeyCode.LeftShift)) {
Debug.Log ("1");
}
if (Input.GetKey(KeyCode.LeftShift)) {
if (Input.GetAxis("Mouse ScrollWheel") != 0) {
Debug.Log("2");
}
}
if (Input.GetAxis("Mouse ScrollWheel") != 0) {
if (Input.GetKey(KeyCode.LeftShift)) {
Debug.Log ("3");
}
}
Care to post the code that isn't working?
Can you try add a FPS Controller Prefab into your scene and check it? Because I still can't make it work even after I add your codes...