Issue with script from Unity Wiki..

I’m pretty new to this whole thing, so thanks for any help you guys can provide.
I was using the script from the wiki (http://wiki.unity3d.com/index.php?title=KeyCombo) in order to create simple inputs turning into action X. This script seemed great as it had the check function in it which I was using to determine if pressing Fire1 would perform the regular or keycombo action.

First, I tried the input for down + right, and everything worked as I had hoped.

Then I tried to do down + left, only to have the keycombo action take effect even though left hadn’t been pressed. I was confused, so I ran it back and removed the “down” all together, and I STILL got the move when I pressed down. When I removed the second move, everything went back to normal (ie not doing the move when "down’ was pressed, still getting the move correctly when “down”, “right” was pressed).

As I said this whole thing is new to me, but for the most part it’s all been pretty logical. This on the otherhand is blowing my mind. Could anyone explain why this is happening? Any tips for resolving it would be greatly appreciated too!

Thanks in advanced guys!

oh my goodness lol. Just spent at least 10-15 minutes on this :slight_smile:
For a while I was just playing around, but then I saw similar things to you…
So, I’m slowly playing and looking around…
There was a bracket out of place, but I’m not even sure that matters. I toss in some debug logs and see some weird results. :slight_smile:

Here’s the fixed line lol

 (buttons[currentIndex] == "left" && Input.GetAxisRaw("Horizontal") == -1)
1 Like

Sure enough that fixed it! Thank you so much for your help!

No problem. :slight_smile: Neat little script.