I have encountered a weird bug. I’m not sure if this is something known to the Unity devs or not. Has anyone else encountered this?
In certain circumstances, the game will no longer respond to a gamepad/controller, but the input system IS responding to keyboard input.
I am using the new input system. Current version 2020.3.7f1
For reasons, I decided not to use the event system for my game’s UI. Most of the time when a menu or other screen appears in my game, I call a function “GetComponent<PlayerInput>().enabled = false;
” within whatever entity the player is controlling (either the player character or another menu/screen.) Then the new menu/screen is instantiated into existence, and the player input on said menu object takes control.
But I had not properly set this up when the player dies. In that situation, I just spawned in a new menu screen without explicitly disabling the input in the player, and the new object took control by virtue of being the newest object.
And I THOUGHT this was working, but I just discovered that the newly spawned menu screen will not respond to a gamepad, only a keyboard.
I have fixed the issue within my game by properly disabling player input in the player character when she dies, but this issue feels like a bug within Unity itself. I should not be able to take control with a new player input unless I am taking FULL control.