Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

PlayerInput Device Disconnect results in Error

Discussion in 'Input System' started by PieterM2H, Nov 4, 2021.

  1. PieterM2H

    PieterM2H

    Joined:
    Aug 2, 2021
    Posts:
    8
    I am using an unmodified version of the Player Input.
    I have setup a simple Input Action Asset and I've added it to the Player Input
    By using the 'Send Messages' behaviour, I call some Debug.Logs to test some functions.

    I have an official Xbox Controller plugged into my PC with a usb cable.
    When I play the game in the editor and pull the cable out of the controller, I get a callback fromOnDeviceLost.

    Let's get into the problem.
    From that point, the entire Input System is not happy. With every action from any device, Keyboard or Mouse, it gives 2 error messages.
    I've tried to set the PlayerSetting to only use the new Input System but also to use both. Still the same error messages.

    Is there anything I can do? Do I have to revert my input package? Or do I have to make a completely new PlayerInput-like script myself?

    Code (CSharp):
    1. IndexOutOfRangeException during event processing of Dynamic update; resetting event buffer
    2. UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>c__DisplayClass7_0:<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
    3. UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)
    Code (CSharp):
    1. IndexOutOfRangeException: Index was outside the bounds of the array.
    2. (wrapper stelemref) System.Object.virt_stelemref_class_small_idepth(intptr,object)
    3. UnityEngine.InputSystem.Utilities.ArrayHelpers.EraseSliceWithCapacity[TValue] (TValue[]& array, System.Int32& length, System.Int32 index, System.Int32 count) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Utilities/ArrayHelpers.cs:740)
    4. UnityEngine.InputSystem.Users.InputUser.UpdateControlSchemeMatch (System.Int32 userIndex, System.Boolean autoPairMissing) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Plugins/Users/InputUser.cs:1358)
    5. UnityEngine.InputSystem.Users.InputUser.UnpairDevices () (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Plugins/Users/InputUser.cs:637)
    6. UnityEngine.InputSystem.PlayerInput.OnUnpairedDeviceUsed (UnityEngine.InputSystem.InputControl control, UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Plugins/PlayerInput/PlayerInput.cs:1817)
    7. UnityEngine.InputSystem.Users.InputUser.OnEvent (UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr, UnityEngine.InputSystem.InputDevice device) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Plugins/Users/InputUser.cs:1733)
    8. UnityEngine.InputSystem.InputManager.OnUpdate (UnityEngine.InputSystem.LowLevel.InputUpdateType updateType, UnityEngine.InputSystem.LowLevel.InputEventBuffer& eventBuffer) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/InputManager.cs:2638)
    9. UnityEngine.InputSystem.LowLevel.NativeInputRuntime+<>c__DisplayClass7_0.<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType updateType, UnityEngineInternal.Input.NativeInputEventBuffer* eventBufferPtr) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/NativeInputRuntime.cs:64)
    10. UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    11. UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)
    12.  
     
  2. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    PieterM2H likes this.
  3. PieterM2H

    PieterM2H

    Joined:
    Aug 2, 2021
    Posts:
    8