- Home /
Question by
Ashzinho031 · Oct 22, 2018 at 06:53 PM ·
input3dmousescrollwheel
Linux and Mouse Wheel,Linux and Mouse ScrollWheel
Hello, I am trying to change the equipped item using the Mouse ScrollWheel in linux but it seems to not do anything, the code is the following:
void Update () {
if(Input.GetButtonDown("OpenInv")) showInv = !showInv;
if(!showInv){
var d = Input.GetAxis("Mouse ScrollWheel");
if(d>0) NextItem(true);
if(d<0) NextItem(false);
}
}
private void NextItem(bool b){
if(b){
selectedItem++;
if(selectedItem>=col)selectedItem=0;
}
else{
selectedItem--;
if(selectedItem<0)selectedItem=(col-1);
}
}
Is there a problem with the code or is the linux build bugged?
Cheers!,Hello!
Comment
I am having the same issue on the latest Linux build. It seems to not be able to detect the scroll wheel when using Cursor Lock but otherwise works normally.
It works on the build, so I added another key to the editor