Auto-switch stopped working

When I last closed down my project, all was working fine.
Today when opened the gamepad is not responding.
I have 2 schemes set up: keyboard and gamepad. Default scheme is and Auto-switch is checked.

It reacts to keyboard input but does react to gamepad. Unless I set the default scheme to gamepad, then the gamepad works. But in that setup the keyboard doesnt react anymore…

I assume this is a bug because all was working correctly the last time I worked on the project and never had issues. Any ideas how to resolve this?

Ok, so I found out the issue is caused by another PlayerInput script on another gameobject. I use this just temporary to trigger certain events with my keyboard. This was working but I noticed when I disable this script, the auto-switch on my player gameObject works again.
The other PlayerInput takes a different InputAction then the player gameobject, also no same keyboard buttons are assigned. Isn’t it possible to have 2 PlayerInputs in a scene?

1 Like

Auto switch only works when using a single Player Input. When having 2 or more, each Player Input “claims” a control scheme. If this behavior is not what you are after you could remove the secondary Player Input used for triggering events, and create a new script that calls those events with something like

using UnityEngine.InputSystem;

// Use this method inside a MonoBehaviour class, and call it inside the Update loop.
void MethodCalledInUpdate()
   {
      if (Keyboard.current.xKey.wasPressedThisFrame)
      {
         // Call your events here
      }
   }
1 Like

Thanks for claring that out