Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug PlayerInputManager.DisableJoining() doesn't trigger PlayerInput.StartListeningForDeviceChange()

Discussion in 'Input System' started by downstroypvp, Sep 9, 2022.

  1. downstroypvp

    downstroypvp

    Joined:
    May 30, 2016
    Posts:
    40
    I am using the latest InputSystem package (1.4.2)

    I guess this is an oversight (or I am using it completely wrong), but this portion of the code from the PlayerInput is only called OnEnable(), which leads to problems (new device not detected by the current (and only) user) if PlayerInputManager.DisableJoining() is called with only one player active:

    Code (CSharp):
    1.          
    2.  
    3.         private void OnEnable()
    4.         {
    5.             ...
    6.             // In single player, set up for automatic device switching.
    7.             if (isSinglePlayer)
    8.             {
    9.                 if (m_Actions != null && m_Actions.controlSchemes.Count == 0)
    10.                 {
    11.                     // No control schemes. We pick up whatever is compatible with the bindings
    12.                     // we have.
    13.                     StartListeningForDeviceChanges();
    14.                 }
    15.                 else if (!neverAutoSwitchControlSchemes)
    16.                 {
    17.                     // We have control schemes so we only listen for unpaired device *input*, i.e.
    18.                     // actual use of an unpaired device (as opposed to it merely getting plugged in).
    19.                     StartListeningForUnpairedDeviceActivity();
    20.                 }
    21.             }
     
    Last edited: Sep 9, 2022
  2. downstroypvp

    downstroypvp

    Joined:
    May 30, 2016
    Posts:
    40
    Looks like it was a configuration problem on my end, everything is working as expected.