Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The second binding for an InputAction triggers an IndexOutOfRangeException #79

Closed
jackpr-unity opened this issue Apr 23, 2018 · 4 comments
Labels
bug Issues where existsing functionality misbehaves

Comments

@jackpr-unity
Copy link
Contributor

jackpr-unity commented Apr 23, 2018

Reproduction Steps:

  1. Create a script with a public InputAction
  2. In the script Start() function, enable the action
  3. Create a gameobject, attach the script, and add at least 2 bindings.
  4. 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 e216c73

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)

@Rene-Damm Rene-Damm added the bug Issues where existsing functionality misbehaves label Apr 23, 2018
@Rene-Damm
Copy link
Contributor

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.

@Rene-Damm
Copy link
Contributor

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)

@jackpr-unity
Copy link
Contributor Author

Make sure you focused the game window. Also, in case it matters, I'm running on Windows.

@jackpr-unity
Copy link
Contributor Author

Can no longer reproduce with commit 7948ead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues where existsing functionality misbehaves
Projects
None yet
Development

No branches or pull requests

2 participants