Using "and" statements for multiple key presses

Hi,
I have 2 single key inputs set up - For example.
(“1” = Do Something)
(“2” = Do Something), but what if I want (“1+2”) to do something else? How can I achieve that using Blueprint??

Many Thanks

Hi,
Thanks for your answer but its not quite what I need. I suppose I should have been more specific in my description.
The way I have it set up is that when I press the “1” key it changes the gun to red so The bullets can only destroy the red items in the game. The “2” key changes the gun to blue so it can only destroy the blue items. The problem is that, just say I press “1” then it sets the red variable to true but when I press the “2” it sets blue to true but red to false so I cant can’t destroy the red items whilst having the blue gun active. (Hope that makes sense)
Coming from unity and using c# I know I could just use

    If (1&&2)
        {
            Do stuff
        }

Just stuck on getting a similar result from Blueprint
I’ve attached an image just incase my dodgy description isn’t clear :slight_smile:
Thanks again for your help.

Hi There!

I made it for you, check this picture:

Explanation:

When you press “N” it plays the sound 1.

When you press “M” it plays the sound 2.

But, if hold “N” and press “M” it plays the “anything else”

Also, if you do the oposite, hold “M” and press “N”, it plays the “anything else” too

Was it what you need?

Hi
OK, did you try a “FlipFlop” node?
It means that it will stays “active” until you press the same key again

So here is an example very simplified:

Hi,
Flip Flop didn’t work for me but I’ve managed to think of a work around. I’ll try and explain incase anyone else has the same problem.
I basically Set a “Delay” when the key is pressed which is set to 0.2. I then Set a variable that will allow me to mix the two keys. Setting it to true and then when the delay is over it sets it to false. Closest I could get to simulating 2 simultaneous key presses…
I’ve added a Image just incase the above doesn’t make sense.
Thanks for your help anyway Filipe :slight_smile: Much appreciated.

I would use a lot of ANDs and ORs and NOTs, its how I make 4 punches work on 2 mouse buttons, if you press left u get a left upper punch, you press right, you get right upper punch, however press left while pressing right, you get lower left punch and vice versa gives you lower right punch. Its a rather complicated system which can probably be simplified, but I’m only using Booleans to achieve it.

In the screenshots there is also implemented bools and branches for different modes that the character is in, mainly combat, magic or neutral state, don’t pay attention to those extras, but its the complete sequence of my mouse button attacks and also attached is how the conditions are set up in the anim bp, I hope it will be of any help, good luck.