InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

InputActions action set action events that fire without any subscribers trigger an IndexOutOfRangeException

Open jackpr-unity opened this issue 8 years ago • 5 comments

How to reproduce:

  1. Create an InputActionsAsset with a set and an action.
  2. Enable the action set in a script
  3. 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.

jackpr-unity avatar Mar 22 '18 20:03 jackpr-unity

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.

jackpr-unity avatar Mar 22 '18 20:03 jackpr-unity

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.

Rene-Damm avatar Mar 22 '18 21:03 Rene-Damm

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)

jackpr-unity avatar Mar 23 '18 18:03 jackpr-unity

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.

jackpr-unity avatar Mar 23 '18 18:03 jackpr-unity

This bug is outdates. The UI has had a makeover and this does not repro.

JiaUnity avatar Mar 05 '19 03:03 JiaUnity