More than 2 simultaneous Action events not reading

I’m building a complicated input system for a game like Virtua Fighter. I got most of it working now, but I’m trying to add simultaneous input detection, Guard + Punch + Kick for example, and I have run in to this problem…

The very base for the simultaneous input detection that I’m using, is a boolean array with every index used for a specific key.

I created some key action events to fill it in.

When a key is pressed, the index linked to it is set to true. When released, that same index is set to false.

It works fine if I do every key one at a time, or a maximum of two keys at once.

If I try 3 or 4… I get some strange behavior.

Example, pressing more than 2 buttons at once, makes the array not update at all.

If I press 2 at once, it’s fine. If I hold those two and press another, It will not update.

It’s like the system can only handle two buttons held at a time.

Can I get a clue on how to fix this?

Check the following:

If you are using a keyboard, make sure your keyboard has N-key rollover. Most general purpose keyboards (especially USB ones) have 2-Key or 4-Key roll-over. What this means is the keyboard cannot detect more than 2/4 key presses at once.
For a info: Rollover (keyboard) - Wikipedia

Thank you, looks like that’s the problem, I can test it with a game pad at least for now.

If the issue is solved, dont forget to mark the thread as solved.