This appears to be a bug wherein even a keyboard polling gameObject loses track of second keypresses across scene loads. One workaround is to keep a minimal main level that keeps track of all the inputs, scores, handles basic mechanics etc, and loads and unloads scenery overlays additively, so those controllers always persist.
Here's a simplistic script that illustrates this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class KeyPressTest : MonoBehaviour
{
float timer;
bool nextSceneLoaded;
public string nextScene;
void Update()
{
timer += Time.deltaTime;
if(timer > 2 && !nextSceneLoaded)
{
SceneManager.LoadScene(nextScene,LoadSceneMode.Additive);
nextSceneLoaded = true;
}
if (Input.GetKey(KeyCode.A))
{
Debug.Log("A " + timer.ToString());
}
if (Input.GetKey(KeyCode.S))
{
Debug.Log("S " + timer.ToString());
}
}
}
Put this in a start scene and provide a second scene name. Hold down the A & S keys and you'll see they continue to both be polled after the second scene loads.
EDIT Note -- editted intro to this answer per @Notbad's clarifying comment below, as after further experimentation it does appear that even if a gameObject is marked as DontDestroyOnload
it will lose the second keypress when a new scene is loaded in single mode. To illustrate this, here is the above script modified so the start scene is discarded and only the poller persists. Sure enough, after the second scene loads, only one key will still be polled...
// Doesn't Work!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class KeyPressTest : MonoBehaviour
{
float timer;
bool nextSceneLoaded;
public string nextScene;
private void Start()
{
DontDestroyOnLoad(gameObject);
}
void Update()
{
timer += Time.deltaTime;
if(timer > 2 && !nextSceneLoaded)
{
SceneManager.LoadScene(nextScene,LoadSceneMode.Single);
nextSceneLoaded = true;
}
if (Input.GetKey(KeyCode.A))
{
Debug.Log("A " + timer.ToString());
}
if (Input.GetKey(KeyCode.S))
{
Debug.Log("S " + timer.ToString());
}
}
}
```