InputActions action set action events that fire without any subscribers trigger an IndexOutOfRangeException
How to reproduce:
- Create an InputActionsAsset with a set and an action.
- Enable the action set in a script
- Trigger the action
Expected: An action without any subscribers should just quietly trigger nothing. Observed: An action without any subscribers triggers an IndexOutOfBounds LogError message in console.
Sorry about not posting a repro project. I'm having some issues with my PC setup. I can create a repro project after I get all this straightened out. Posting now so that at least a stub exists recording the issue.
That's fine. If the repro steps are as simple as this, a repro project isn't worth the hassle IMO.
One thing that's always helpful, though, is to post the stack trace if you get an exception.
Here is a stack trace. This action was set up through an InputActionAsset.
IndexOutOfRangeException: Array index is out of range.
ISX.Utilities.ReadWriteArray`1[ISX.InputActionSet+ModifierState].get_Item (Int32 index) (at Packages/com.unity.inputsystem/InputSystem/Utilities/ReadWriteArray.cs:65)
ISX.InputAction.NotifyControlValueChanged (ISX.InputControl control, Int32 bindingIndex, Double time) (at Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs:761)
ISX.InputManager.FireActionStateChangeNotifications (Int32 deviceIndex, Double time) (at Packages/com.unity.inputsystem/InputSystem/InputManager.cs:1994)
ISX.InputManager.OnUpdate (InputUpdateType updateType, Int32 eventCount, IntPtr eventData) (at Packages/com.unity.inputsystem/InputSystem/InputManager.cs:1849)
ISX.LowLevel.NativeInputRuntime+<>c__AnonStorey0.<>m__0 (NativeInputUpdateType updateType, Int32 eventCount, IntPtr eventPtr) (at Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs:58)
UnityEngineInternal.Input.NativeInputSystem.NotifyUpdate (NativeInputUpdateType updateType, Int32 eventCount, IntPtr eventData) (at C:/buildslave/unity/build/Modules/Input/Private/Input.cs:90)
Just tried to trigger this failure through a public InputAction on a script - I guess that doesn't actually trigger the error. It only seems to fail through an InputActionAsset asset. I will edit the details of this issue appropriately.
This bug is outdates. The UI has had a makeover and this does not repro.