Multiple Keys Checked with containers Array and Set to a "Was Input Key Just pressed"?

I want to Check multiple keys like WASD with any container types to check if any of those key inputs are pressed under the “Was Input Key Just Pressed/Released”. My issue is that node only allows for one input; when the only way is to use 4 “Was Input Key Just Pressed/Released” nodes to check each key separately. But I’d like to check for those keys being pressed in one instead of four separate Just Pressed nodes. Also, does the node Just Pressed 4 or more times cause more processing each node I add?

280102-arrayandset-keys.jpg

280104-variables.jpg

You may want to make use of the “Any Key” input event.

Image example: [Imgur: The magic of the Internet]

The “Pressed Keys” array in this example can be used to check multi-key combos.

Definitely using pure nodes like this will result in vast amounts of function calls. If you find yourself needing result of a pure node like Get Player Controller and the and the value doesn’t change in your game, you have the option of saving the player controller reference as a variable.

(Couldn’t upload image directly for some reason).

1 Like

Awesome, Thank you. It was a lot easier of a fix than I thought. Never even thought to directly check from all keys which were being pressed.