I’m making a shooter that fires a special bullet when two buttons are pressed at once. Is the code for this as I think it is?
if (Input.GetButtonDown("Fire1" && "Fire2"))
I’m making a shooter that fires a special bullet when two buttons are pressed at once. Is the code for this as I think it is?
if (Input.GetButtonDown("Fire1" && "Fire2"))
close …
if ( Input.GetButtonDown("Fire1") && Input.GetButtonDown("Fire2") )
each time you are checking for a condition, you have to check them seperately, you cannot combine them like you were =]
Just a note : this is hoping that you press both the keys in exactly the same frame, I don’t know what the odds are of that happening. You may need timers for both, then check if they are just GetButton but not timed out (say 0.2 seconds).
I would do
if ((Input.GetButton("Fire1") && Input.GetButtonDown("Fire2"))
|| (Input.GetButtonDown("Fire1") && Input.GetButton("Fire2)))
The first line checks if you press 2 while holding down 1, the other checks if you press 1 while holding down 2.
_
This way, you don’t have to press both on exactly the same frame.