Input key (GetKey/GetAxis) ignored when loading new scene while pressing more than one key

Hello everyone. So as the title says, here is the thing:

I’m developing a top-down game (like Legend of Zelda, Binding of Isaac, etc.) for a game jam. When the player changes for one scene to another, it is expected that the player keeps pressing towards the place he wants to go, and when placed in the new scene, the player keeps moving towards that direction without needing to change the pressed buttons.

The problem comes when I try to use Unity’s Input system. Pressing only one key is no problem, however, if the player presses more than one key when doing the scene change, only the last pressed key will still work when next scene loads. This leads to many undesired behaviors that break the movement connection between scenes.

I have searched about this issue but have not found a simple (or working) solution.
Some references:

I have tried to use Input.ResetInputAxes with no results.
I tried to use GetKey or GetAxis, but both input methods have the same result, which is usually noted when the player is walking diagonally.

Worst thing, this issue has been around since 2012! Unity being a game engine where this kind of input is very much required surely has a solution for this right? Or is this not how Input is supposed to be used? How can I solve this issue?

Here is the code I’m using

Thank you very much for your help and time!

Here is my solution:

Changing scenes without clearing the Input subsystem:

1 Like

I did wanted to avoid messing with the scenes, but it does seem it is the only thing working and tested right now. I’ll give it a read and see how to adapt it to my project. Thank you :slight_smile:

1 Like