Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Nintendo Switch: STAT event with state format NPAD cannot be used with device 'Gamepad:/Gamepad1'

Discussion in 'Input System' started by erenaydin, May 16, 2022.

  1. erenaydin

    erenaydin

    Joined:
    Mar 1, 2011
    Posts:
    384
    Hello,
    We made a switch build, touch works fine but when we press dpad on switch controllers we get this:


    InvalidOperationException: STAT event with state format NPAD cannot be used with device 'Gamepad:/Gamepad1'
    at UnityEngine.InputSystem.InputControlExtensions+InputEventControlEnumerator.Reset () [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.InputSystem.InputControlExtensions+InputEventControlEnumerator..ctor (UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr, UnityEngine.InputSystem.InputDevice device, UnityEngine.InputSystem.InputControlExtensions+Enumerate flags, System.Single magnitudeThreshold) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.InputSystem.InputControlExtensions+InputEventControlCollection.GetEnumerator () [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.InputSystem.Users.InputUser.OnEvent (UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr, UnityEngine.InputSystem.InputDevice device) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.InputSystem.Utilities.DelegateHelpers.InvokeCallbacksSafe[TValue1,TValue2] (UnityEngine.InputSystem.Utilities.CallbackArray`1[System.Action`2[TValue1,TValue2]]& callbacks, TValue1 argument1, TValue2 argument2, System.String callbackName, System.Object context) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.InputSystem.InputManager.OnUpdate (UnityEngine.InputSystem.LowLevel.InputUpdateType updateType, UnityEngine.InputSystem.LowLevel.InputEventBuffer& eventBuffer) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.InputSystem.LowLevel.NativeInputRuntime+<>c__DisplayClass7_0.<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType updateType, UnityEngineInternal.Input.NativeInputEventBuffer* eventBufferPtr) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngineInternal.Input.NativeInputSystem.NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType updateType, System.IntPtr eventBuffer) [0x00000] in <00000000000000000000000000000000>:0
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    UnityEngine.InputSystem.Utilities.DelegateHelpers:InvokeCallbacksSafe(CallbackArray`1&, InputEventPtr, InputDevice, String, Object)
    UnityEngine.InputSystem.InputManager:OnUpdate(InputUpdateType, InputEventBuffer&)
    UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)


    I'm wondering if switch controller is supported by Unity Input System? Or should I create interface to look for native input from Switch?
     
  2. joaorequiao

    joaorequiao

    Joined:
    Oct 15, 2015
    Posts:
    6
    Did you find a way to fix this? I'm getting the same error here.
     
  3. erenaydin

    erenaydin

    Joined:
    Mar 1, 2011
    Posts:
    384
    No, the exception is coming from the deeps of UIS. I am planning to create a new implementation on my input service for Switch then I will use the SDK directly. I wont be using Unity Input System.
     
  4. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,061
    Most Switch-related information is under NDA and you shouldn't discuss it publicly. Check Nintendo's developer documentation and ask questions on Nintendo's developer forums instead.
     
  5. erenaydin

    erenaydin

    Joined:
    Mar 1, 2011
    Posts:
    384
    This is about Unity's new Input System.
     
  6. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,061
    It's about Unity's Input System on the Switch? There are Switch-specific packages that are provided by Nintendo that you need to add to your project. Again, the proper place to ask about anything related to Unity on the Switch is Nintendo's developer forums. Since everyone is under NDA, you won't get proper answers here.
     
  7. erenaydin

    erenaydin

    Joined:
    Mar 1, 2011
    Posts:
    384
    I got your point but I don't have any Nintendo specific package in my project and my problem is not related to that.
    I am using X engine and Y package of that engine but it throws exception on Switch. I cannot be forced to ask that it on Nintendo forums.
    'Again' it's a Unity's Input System issue and I cannot let Unity guys know about that from another forum.
    Do you want me to send a bug report to Switch tech support about Unity's Input System? Probably no.
     
  8. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,061
    The Unity guys are active on the Nintendo developer forums and Nintendo devs will forward issues to Unity when necessary. Input is platform-specific and the Nintendo forums are absolutely the right place to ask Unity questions that relate to the Switch.

    You need to install an additional package that is provided by Nintendo for the Input System to work correctly on the Switch. I recommend you check Nintendo's Unity documentation that includes information about using the Input System on the Switch.
     
    patrickgh3 likes this.
  9. patrickgh3

    patrickgh3

    Joined:
    May 22, 2015
    Posts:
    3
    I had this exact same error, and it turns out I didn't actually install that additional package on that Nintendo documentation page you mentioned Adrian. I had misinterpreted the instructions on the page. Now that I've installed the package, that error no longer occurs. Thanks!