I'm working on a prototype for a 2D sidescroller game and I'm having some problems making the player shoot and run at the same time.
The overview is:
1. While the player is holding the "Shift" key, the player starts to run. As soon the player releases the "Shift" key, it starts to walk instead. This part is working as intended.
2. If the player presses the "KEYKP2" (Numberpad 2), it shoots a projectile. This is working as intended in every state but the "Running" state, where the player is also holding the "Shift" key.
I've tried the solution described in Godot Documentation, but to no avail.
The code is written as follows:
if event is InputEventKey and event.pressed:
print("pressed: " + String(event.scancode))
if event.scancode == KEY_KP_2:
1. When I press the KEYKP2 key, it prints "16777352";
2. When I press the Shift key, it prints "16777237";
3. When I press the Shift and KEYKP2 at the same time, it prints "16777234"
As shown, I'm having a hard time to detect the "Shift+NP2" press. Is there a specific scancode for "Shift+KP_2"?