How can I make sure that the game is selected after closing out of a pause menu?
I know that this sounds like a weird question, but hear me out.
I have a character that can shoot bullets and can move around. I also have a simple pause menu. Everything works as intended up until you go into the pause menu, then click the "continue" button. This button just closes the menu and unpauses the game. After you click this button, if you move left and shoot at the same time, the game pauses, then unpauses when you do it again.
I don't know what causes this, but it fixes itself by just left clicking anywhere. So I'm just wondering, is there a way to fix this? When I close the pause menu via the "continue" button, how can I make sure that the game itself is selected so this bug doesn't occur?
Thanks in advance :D
EDIT: Also, if I build the game and play it, the game will sometimes crash whenever the bug occurs (normally if I shoot and move left too quickly, and repeatedly) instead of just pausing and unpausing the game.