New to Unity.
I’m transitioning from my start menu into the game, and the first input from mouse and keyboard is always ignored.
If I load the scene directly, instead of through the start menu, there is no issue.
So that leads me to believe that something in my start menu setup is screwing up.
I have the this my Hierarchy
and I have the ‘MainMenu’ attached to the canvas.
and I’m loading the scene using this
public void Load_Grassland()
{
SceneManager.LoadScene(1);
}
It all seems fairly basic to me, but I guess I’ve missed a step somewhere.
Googled around for awhile, and couldn’t find anyone else with the issue, so posting here and hoping for the best. xD
Anyone have a clue why the first input is failing?
Only time I’ve seen a click-button break like this happen is when the game loses focus: you have to click it once to refocus it.
However, changing scenes does drop certain other continuous input states, which is incredibly annoying.
Fortunately I made a workaround for it, and you can read all about it here:
Is it a bug? Arguably. Will it be fixed? Probably not.
Instead, engineer thyself a trivial workaround and get back to game-making!
The work-around:
Load your next scene additively
When it finishes loading, unload the previous scene
Note now the Input axes do not reset when you do this.
Thank you, drive through!
I threw together an example project to prove this workaround.
Read directions in Scene1.unity for setup: you need to add Scene1 and Scene2 and Scene3to your Editor Build Se…
1 Like
Kurt-Dekker:
Only time I’ve seen a click-button break like this happen is when the game loses focus: you have to click it once to refocus it.
However, changing scenes does drop certain other continuous input states, which is incredibly annoying.
Fortunately I made a workaround for it, and you can read all about it here:
https://discussions.unity.com/t/465068/24
I found a solution using your comment as a guidepost.
SceneManager.LoadScene(1, LoadSceneMode.Single);
Adding the load scene mode single, seems to completely erase the main menu from existence, instead of layering on top.
I think the issue is/was that the mouse event triggered on the down press, and something about the button was still selected, and since it was still in the background, you needed to push any key to get out of that state.
Anyway, that’s just my guess!
The above addition worked perfectly and removed the issue.
Thanks for the help!
1 Like