I ran into a strange bug where my input was completely ignored if I switched levels while the game was paused. The project I am currently working on is a bit big now and started from around 4.3, so I don’t know if it’s feasible to attempt to reproduce.
The general setup that I had that caused this to happen:
Have a ‘Title Screen’ level and the actual game level
Title screen loads into main game level with a UMG button that calls ‘Open Level’ node
Pause the game to go into the pause menu and return to title screen using ‘Open Level’ node
All input lost; can’t even push ESC to quit game from viewport (Mouse input still works)
The way I fixed it was simple once I got to thinking about how pause affects parts of the engine. Before the player returns to the ‘Title Screen’ from the pause menu, I unpause the game.
EDIT: Changed topic title from “Set game paused can potentially stop all input when level switching (and a quick fix)” to “Set Input Mode UIOnly locks input on level switch”
The problem was related to the ‘Set Input Mode UI Only’ node being called right before the level switch. After I removed the call to the node, everything was fine.
I was unable to reproduce this issue on our end with the information provided. I have a few questions that will help narrow down what issue it is you are experiencing.
Quick questions:
I see that you mentioned it may not be possible to reproduce this issue in a clean project. Could you check see if the current blueprint setup that you are using can reproduce this issue when re-made in a clean project?
If so, could you provide any differences or discoveries that will help reproduce this issue on our end?
Could you provide screen shots of the blueprints involved with this issue?
After the setup is complete, push the button to restart the level. You will then lose all input except for mouse. ESC won’t quit the in-editor game and Shift + F1 will not bring out the mouse (must alt+tab or some other OS method to bring out the mouse).
The problem was related to the ‘Set Input Mode UI Only’ node being called right before the level switch. After I removed the call to the node, everything was fine.