[BUG FIX] Input device icons reset to "Mouse/Keyboard" when switching scenes
❤️
2
🔥
2
When switching scenes (main menu -> gameplay, and vice-versa), the input device icons (mouse & keyboard / XBOX / PS) always get reset to mouse & keyboard.
To prevent that, we can store (using PlayerPrefs) the last detected input device, and retrieve it when a new scene is loaded.
In UIControllerButtonManager.cs:
In Start(), replace:
UpdateControllerType(GameManager.InputSystem.playerInput);
with:
if (PlayerPrefs.HasKey("controller_type"))
{
SetControllerType((EControllerType)PlayerPrefs.GetInt("controller_type"));
}
else
{
UpdateControllerType(GameManager.InputSystem.playerInput);
}
In OnDestroy(), add this line anywhere inside the function:
PlayerPrefs.SetInt("controller_type", (int)m_controllerType);

💬 Comments (0)
Be the first to comment! Join our Discord to share your thoughts.
Want to continue the conversation?