Search Issue Tracker
Fixed in 0.3.0
Votes
0
Found in [Package]
0.2.0-preview
Issue ID
1133674
Regression
No
[Scripting] When using ReadValue<T> with a mismatched value type, a wrong exception is thrown.
Github bug: https://github.com/Unity-Technologies/InputSystem/issues/361
From forum: https://forum.unity.com/threads/indexoutofrange-on-axis-action.601777/
When using ReadValue<T> on an Input Control, if the <T> does not match the value type, ISX throws IndexOutOfRangeException, which is the wrong exception to use.
The exception should be accurate about the error, and help in identifying the issue. In the case, it should reflect the mismatched variable type (ArgumentException?)
Repro:
1. Download project and package at: https://github.com/Unity-Technologies/InputSystem
2. Open with 18.3 or 19.1
3. Open scene: Demo -> SimpleDemo -> SimpleDemo
4. Open C# script: Demo -> SimpleDemo -> SimpleController_UsingActions_InAsset (the one used on Player gameobject in the scene)
5. In the script, go to Awake() function, and finc "controls.gameplay.move.preformed += ctx => _Move = ctx.ReadValue<Vector2>()"
6. Change the "Vector2" at the end to "Vector3"
7. Enter Playmode and move around with WASD
Actual: IndexOutOfRangeException is thrown
Expected: Some other exception about mismatched variable type is thrown (ArgumentException?)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Unused Particle System Renderer Mesh settings cause performance degradation when calling SetActive
- Project Browser shows the Asset folder empty when Select Dependencies is clicked without any asset selected
- Export as JSON and CSV options missing from the Quick Search save feature
- Crash on IMGUI::GUIWindow::OnGUI when rendering scene view window in play mode in a specific project
- "FileNotFoundException" & "IOException" thrown when adding "User" Index after deleting "Assets" Index in Search Index Manager window
Add comment