Is there a way to use the mouse wheel as a normal button, instead of an axis?
I just want 2 normal button style inputs in the Input Manager, just scroll up and scroll down. Is this possible?
Answer by Yuvii · Dec 08, 2015 at 10:16 AM
Not sure, but you can use the axis the way you want to.
int SW = Input.GetAxisRaw("Mouse ScrollWheel");
if(SW == 1){
// You're scrolling up
}
else if(SW == -1){
// You're scrolling down
}
This is the same as a
if(Input.GetKey(...))
But since there's not really a 'press down' and a 'press up' on the scroll wheel axis, if you want to swith weapon for example and you want it to switch only on the next or on the previous weapon on your list, you should add a SW = 0; on the end of both conditions, but not sure if this'd work.
yeah i suppose there isn't a press down and up. alright, ill probably just go with what you have here, thanks :)
Your answer
Follow this Question
Related Questions
Cross-Platform Input 3 Answers
XboxCtrlrInput Dead Zone 0 Answers
Is there anyhow to know if the axe is positive or negation 0 Answers
Input.GetAxis() wrong values on laptops 0 Answers