In my debug I see 1 and 2 but never 3. WaitForAnyKey = 2f Code (CSharp): if (deathScreenActive) { if (waitForAnyKey > 0) { Debug.Log("1"); waitForAnyKey -= Time.deltaTime; if (waitForAnyKey <= 0) { Debug.Log("2"); if (Input.anyKeyDown) { Debug.Log("3"); SceneManager.LoadScene(mainMenuScene); } } } } Why isn't the Input firing? Thanks!
Is it me or there is a Logic problem with this code ? I mean this Code (CSharp): if (waitForAnyKey <= 0) Is the ELSE of This Code (CSharp): if (waitForAnyKey > 0) I'm almost sure that Debug.Log("2"); is not executed more than One frame... then you get out of the main IF statement. Sorry if i misunderstood your code/goal.
This was it. I created a new bool to handle the issue. Thank you! Code (CSharp): if (deathScreenActive) { if (waitForAnyKey > 0) { Debug.Log("1"); waitForAnyKey -= Time.deltaTime; if (waitForAnyKey <= 0) { Debug.Log("2"); canPressKeys = true; } } if (canPressKeys && Input.anyKeyDown) { Debug.Log("3"); SceneManager.LoadScene(mainMenuScene); } }