x


Input Manager Question

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.

more ▼

asked Jan 06 '12 at 07:38 PM

zachypin gravatar image

zachypin
71 35 38 38

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jan 06 '12 at 08:43 PM

Lo0NuhtiK gravatar image

Lo0NuhtiK
3.5k 1 9 39

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x952
x40
x34
x14
x5

asked: Jan 06 '12 at 07:38 PM

Seen: 707 times

Last Updated: Jan 06 '12 at 08:50 PM