I am using the input manager “vertical” to account for my avatar moving forward and backwards. I was wondering if it was possible to set “positive” to both mouse 0 and mouse 1. In the case that I want more than one button to be necessary for the input value to be set to positive.
Thanks.
Yes. Just go to Edit-> Project Settings -> Input .... then in the inspector panel, make a new input axes , name it "Vertical" ... then on the positive button, type 'mouse 0' and on the alternate positive button type 'mouse 1' ... or whatever you're wanting to use.
Note : in case you're unsure how to make a new input in there, where it says 'size' change that number to add one more input axes, then go down and name it whatever you want the input to be named and set it up how you want it
Edit : I might have misunderstood your question. If you’re wanting it to not do anything unless both buttons are being held down at the same time, you could do something like setting one of them up as the positive button, but then in your code do something like this →
function Update(){
if(Input.GetMouseButton(0) && Input.GetAxis("Vertical")){
//do stuff ;
}
}
then, if the mouse button is held AND the vertical button is being pressed also, it will do stuff.