Input field stop registering key input after level load?

Hi,

The UGUI Input field is working fine in my menu scene the first time it loads as the first level in the game, but if you return to the menu from another scene the input field stops registering input from the keyboard. All the buttons still work with the mouse and the input field is interactable and enabled and therestill is an event system in the scene.

The only way I can get it to work normally after reloading the menu scene is by clicking once outside the game window and then returning to the input field. Why is this happening and how do I fix it?

Completely unrelated I have a don’t destroy on load on my game manager, but it has 0 to do with the inputfield. I’m only mentioning this because I’ve read that it can sometimes cause UGUI components to act strange.

Another strange thing that happens when returning to the main menu level is that even though all lighting is still on and untouched, the scene is really dark for some reason. If anybody has had the same problems and knows how to fix it please let me know, thank you

Make sure you are keeping track of and setting which scene is the “active” scene as that controls where the lighting settings come from. If you’re actually unloading your menu scene (by loading a new scene for example) then you will lose the lighting settings from that scene. Maybe look into additive scene loading instead.

As for your input field problem, make sure you still have an event system(you mentioned this) and an input module(you didn’t mention this) around when you get back to the menu. Also make sure there’s not some other UI element blocking Raycasts in front of the input field.

1 Like

Thank you very much. I’ll look into this and maybe the unloading of the menu scene is also what causes the input field problem.

Just found out none of these oddities occur in the build, The inputfield and lighting works everytime no matter what in the build it’s only in the editor it looks odd and the inputfield doesnt work when level is re-loaded for some reason