The second binding for an InputAction triggers an IndexOutOfRangeException
Reproduction Steps:
- Create a script with a public InputAction
- In the script Start() function, enable the action
- Create a gameobject, attach the script, and add at least 2 bindings.
- Press play and activate the second binding
Alternatively, here is a repro scene all set up: ActionTest.zip
Expected Result: The action is performed with no errors.
Observed Result: An IndexOutOfRangeException is triggered
Tested with 2018.2.0b1 and commit e216c7333858a2682b37964721f54201580565f9
Stack Trace: IndexOutOfRangeException: Array index is out of range. UnityEngine.Experimental.Input.Utilities.ReadWriteArray`1[UnityEngine.Experimental.Input.InputActionSet+ModifierState].get_Item (Int32 index) (at Packages/com.unity.inputsystem/InputSystem/Utilities/ReadWriteArray.cs:65) UnityEngine.Experimental.Input.InputAction.NotifyControlValueChanged (UnityEngine.Experimental.Input.InputControl control, Int32 bindingIndex, Double time) (at Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs:802) UnityEngine.Experimental.Input.InputManager.FireActionStateChangeNotifications (Int32 deviceIndex, Double time) (at Packages/com.unity.inputsystem/InputSystem/InputManager.cs:1996) UnityEngine.Experimental.Input.InputManager.OnUpdate (InputUpdateType updateType, Int32 eventCount, IntPtr eventData) (at Packages/com.unity.inputsystem/InputSystem/InputManager.cs:1861) UnityEngine.Experimental.Input.LowLevel.NativeInputRuntime+<>c__AnonStorey0.<>m__0 (NativeInputUpdateType updateType, Int32 eventCount, IntPtr eventPtr) (at Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs:57) UnityEngineInternal.Input.NativeInputSystem.NotifyUpdate (NativeInputUpdateType updateType, Int32 eventCount, IntPtr eventData) (at C:/Users/jackpr/Ono/unity/Modules/Input/Private/Input.cs:90)
Are you on latest head? The line numbers suggest you're running old code.
I've tried this on latest head but couldn't reproduce. Your scene runs fine.
Actually, while I don't see an exception, what I see is that there's no response on the action either. Looking at it.
(And NVM re before, just realized you linked the commit you tested with)
Make sure you focused the game window. Also, in case it matters, I'm running on Windows.
Can no longer reproduce with commit 7948ead2797c9551010b7e90017852ad3669b139