Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Input System bugs

Discussion in 'Input System' started by Rallix, Mar 20, 2019.

  1. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    Hi,
    I've been trying the new input system and so far I really like it! It's hard to pick something specific, as I didn't go truly in depth to experience the more complex new features but from the get-go: the general workflow with Action Maps/Actions, control schemes and the editable InputSettings asset which automatically generates interfaces to set things up, etc.
    I'm quite eager for the hopefully more stable 1.0 version, too.

    As for the problems, I've been writing down some I encountered (more on that later) – although with the work-in-progress documentation, it's hard to tell what's supposed to be working (and therefore is a bug) and what is still left to be implemented.

    Input.png

    I guess the major problem I have is not being to able to register any input in WebGL build. It's working fine in the Editor, the build reports something like:
    The devicemotion events are blocked by feature policy.
    The deviceorientation events are blocked by feature policy.

    This is in Unity 2018.3.8f1, so judging by this thread, would it be working if I switched to the current 2019.1 beta?

    The other big trouble I had was getting the horizontal movement axis working regardless of whether a keyboard or a gamepad is used. In the setup as seen above, the keyboard axis value went (correctly) from -1 to 1, but the gamepad was inverted (1 to -1) – I'm not sure why.
    I tried a number of things, from switching the positive and negative key, adding processors (like Scale: -1 or Invert), swapping min/max values… which either didn't really do anything or made the negative side always return zero.
    Axis1.png
    In the end, I realised I just need to detect when the player is currently using a gamepad and inverted the value myself like:
    Code (CSharp):
    1. float finalAxis = context.ReadValue<float>();
    2. if (!Keyboard.current.anyKey.isPressed) finalAxis *= -1;
    However, I wish I knew a better way than this.
    I had problems with the "Hold" interaction, too – it immediately returned "performed" no matter what time I set up.
    Hold.png
    I ended up with "Press And Release" and calculating the time myself. I think this might be related to the following problem: Hold.gif One thing is that it doesn't remember you overwriting the default value, but another thing (shared by interactions such as Scale etc.) is that I wasn't able to enter a decimal value.
    Isn't this another problem with 'decimal comma' which the whole Package Manager seems to be currently having (case 1125027)?
    In that case, I'd understand why it zeroes out all decimal values and as a result, immediately returns performed for Hold.

    Then some minor stuff I wrote down:

    • Generating a new script file always produces a (harmless) error:
    Code (csharp):
    1. Assertion failed on expression: 'GetAssetScriptingType(*m_RefreshQueue.begin()) != AssetScriptingType::Script'
    2. UnityEditor.Experimental.AssetImporters.AssetImporterEditor:OnDisable()
    • Doublicking a name (action map, action) to edit it while another name is already being edited at the moment results in only being able to write a single character at a time. Simply, losing focus doesn't close the currently editable field.
    Focus.gif

    Due to the image limit, I'll continue in the next post.
     
    Last edited: Mar 20, 2019
  2. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    • And right-clicking when editing doesn't change focus either, so you might accidentally end up deleting the wrong thing
    Focus not changed.gif

    Which also results in the following errors:

    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEngine.Experimental.Input.Editor.ActionInspectorContextMenu.GetSelectedActionLine () (at Library/PackageCache/com.unity.inputsystem@0.2.1-preview/InputSystem/Editor/InputActionAsset/ActionInspectorContextMenu.cs:141)
    3. UnityEngine.Experimental.Input.Editor.ActionInspectorContextMenu.OnActionsContextClick (UnityEditor.SerializedProperty property) (at Library/PackageCache/com.unity.inputsystem@0.2.1-preview/InputSystem/Editor/InputActionAsset/ActionInspectorContextMenu.cs:48)
    4. UnityEngine.Experimental.Input.Editor.InputActionTreeBase.ContextClicked () (at Library/PackageCache/com.unity.inputsystem@0.2.1-preview/InputSystem/Editor/InputActionAsset/InputActionTreeBase.cs:155)
    5. UnityEditor.IMGUI.Controls.TreeViewController.HandleUnusedEvents () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:840)
    6. UnityEditor.IMGUI.Controls.TreeViewController.OnGUI (UnityEngine.Rect rect, System.Int32 keyboardControlID) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:620)
    7. UnityEditor.IMGUI.Controls.TreeView.OnGUI (UnityEngine.Rect rect) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControl.cs:414)
    8. UnityEngine.Experimental.Input.Editor.AssetInspectorWindow.DrawActionsColumn (System.Single width) (at Library/PackageCache/com.unity.inputsystem@0.2.1-preview/InputSystem/Editor/InputActionAsset/AssetInspectorWindow.cs:489)
    9. UnityEngine.Experimental.Input.Editor.AssetInspectorWindow.OnGUI () (at Library/PackageCache/com.unity.inputsystem@0.2.1-preview/InputSystem/Editor/InputActionAsset/AssetInspectorWindow.cs:387)
    10. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    11. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    12. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    13. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    14. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
    15. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
    16. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:310)
    17. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:361)
    18. UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:320)
    19. UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266)
    20. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438)
    21. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:421)
    22. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:401)
    23. UnityEngine.Experimental.UIElements.EventDispatcher.PropagateEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:754)
    24. UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:599)
    25. UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307)
    26. UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:176)
    27. UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245)
    28. UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68)
    29. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    Code (csharp):
    1. ArgumentException: GUILayout: Mismatched LayoutGroup.mouseDown
    2. UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:311)
    3. UnityEditor.EditorGUILayout.BeginScrollView (UnityEngine.Vector2 scrollPosition, System.Boolean alwaysShowHorizontal, System.Boolean alwaysShowVertical, UnityEngine.GUIStyle horizontalScrollbar, UnityEngine.GUIStyle verticalScrollbar, UnityEngine.GUIStyle background, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9092)
    4. UnityEditor.EditorGUILayout.BeginScrollView (UnityEngine.Vector2 scrollPosition, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9062)
    5. UnityEngine.Experimental.Input.Editor.AssetInspectorWindow.DrawPropertiesColumn (System.Single width) (at Library/PackageCache/com.unity.inputsystem@0.2.1-preview/InputSystem/Editor/InputActionAsset/AssetInspectorWindow.cs:514)
    6. UnityEngine.Experimental.Input.Editor.AssetInspectorWindow.OnGUI () (at Library/PackageCache/com.unity.inputsystem@0.2.1-preview/InputSystem/Editor/InputActionAsset/AssetInspectorWindow.cs:388)
    7. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    8. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    9. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    10. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    11. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
    12. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
    13. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:310)
    14. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:361)
    15. UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:320)
    16. UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266)
    17. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438)
    18. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:421)
    19. UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:401)
    20. UnityEngine.Experimental.UIElements.EventDispatcher.PropagateEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:754)
    21. UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:599)
    22. UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307)
    23. UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:176)
    24. UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245)
    25. UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68)
    26. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

    • "Waiting for input…" kept returning "scroll [Mouse]" no matter what I actually pressed.
    • Some buttons are not working on level restart, although some ("jump") do
    Jump.png

    The last one – again, I'm not sure why but when restarting a level (= reloading the active scene), most buttons stop working, but strangely, jump seems to be working fine.
    As far as I know, there's nothing persistent ("Dont Destroy On Load") in the scene, so when reloading, it should probably work the same as when entering the playmode for the first time.

    The input is simply registered as:
    Code (CSharp):
    1. [SerializeField] InputManager controls = default;
    2. void Awake()
    3. {  
    4.     controls?.Player.SetCallbacks(this);
    5. }
    6. void OnEnable() => controls.Player.Enable();
    7. void OnDisable() => controls.Player.Disable();
     
    Last edited: Mar 20, 2019
  3. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Thank you for the detailed feedback. Very helpful.

    Could be you're getting caught by one of the annoyances with WebGL gamepad support. One problem we have there is that the only way to get standardized gamepads (i.e. so you know that the button you're targeting is really the one you mean) is if they follow the "standard" mapping as specified by the W3C standard. However, in my own (limited) testing I found that it very much depends on the browser, platform, AND gamepad whether you'll get a gamepad with a mapping or a gamepad with no mapping at all.

    For gamepads that do not come with a standard mapping, we would have to supply specific layouts for specific browser+platform+gamepad combinations. Not sure we'll ever go there. Remains to be seen. Definitely a nightmare. ATM we have none of those.

    What this means is that currently a gamepad on WebGL will only come out as a Gamepad in the new input system if it uses the "standard" mapping. If not, it'll come out as a joystick. If desired, it should be possible to bypass that like so:

    Code (CSharp):
    1. // Nuke definition of WebGL joysticks.
    2. InputSystem.RemoveLayout("WebGLJoystick");
    3.  
    4. // Turn any WebGL gamepad into a Gamepad.
    5. InputSystem.RegisterLayout<WebGLGamepad>(
    6.     matches: new InputDeviceMatcher()
    7.         .WithInterface("WebGL")
    8.         .WithDeviceClass("Gamepad"));
    What's the gamepad and platform? Think we had some where it was coming out incorrectly and have fixed it recently.

    Looking at your setup, I'd expect it to work. However, you wouldn't necessarily need an axis composite there. An alternative is to just bind to the gamepad stick's X axis.

    There was a bug with startTime and duration on actions which probably caused this. Was fixed in 0.2.6.

    Hmm, interesting. We have to look into that. IIRC the code here is neutral to locales meaning that it'd have to be a period not a comma. In the UI, we should probably convert for presentation on the fly. Made a note.

    Haven't seen that. I think this shouldn't happen on 2019.1 anymore, though.

    Confirmed. Will fix. Logged ticket here.

    The action editor and inspectors recently received a major overhaul that landed in 0.2.6. This is fixed as far as I can see.

    Since the overhaul, we do have some error occasionally popping up when using context menus in the action error. We're looking into that.

    Yup, known issue with the mouse. Setting a type on the action so that the mouse scroll wheel isn't taken into account should help work around it in some cases.

    Ok, that is curious. We'll have a look.
     
  4. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    Hi, and thank you very much for the fast reply.

    Thank you for the explanation.
    But does that mean when the gamepad input isn't working, neither will the keyboard if it's related to the same action? Just to clarify, no input works in the build, not even WASD or arrow keys.

    WebGL + the basic Xbox One wireless controller
    Unity 2018.3.8f1 on Windows

    I'll try that (don't have the gamepad right now) and report if it helps. I originally wanted to mimic the keyboard input as close as possible, in order to handle them in the same way, but this approach seems okay, too.

    It does. Tried with a different project, 2019.1.0b7.
    Code (csharp):
    1. Assertion failed on expression: 'GetAssetScriptingType(*m_RefreshQueue.begin()) != AssetScriptingType::Script'
    2. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Code (csharp):
    1. Assertion failed on expression: 'GetAssetScriptingType(*m_RefreshQueue.begin()) != AssetScriptingType::Script'
    2. UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

    We had a playtesting session today and found out it doesn't happen always, although most of the time it does.

    Here's a gif (it starts before anything is logged into the console):
    Restart.gif

    I wanted to try if another restart could fix the controls again – doesn't seem so. Each successive restart in a row took more time than the previous one and eventually froze the Editor, so I'll leave that be for now.

    EDIT:
    One more thing. I know it's probably ill-advised to change the input settings during playmode, but nevertheless, if they're saved ("Save Asset"), the Editor will then start spamming a barrage of errors after exiting it until the code is compiled again.
    Saved during playmode.png
    I feel either the errors should be caught, or the "Save Asset" button / "Auto-Save" should be disabled during playmode.
     
    Last edited: Mar 23, 2019
  5. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    Here's the update about the gamepad. Yes, using just leftStick/x [Gamepad] fixes the reversed input problem and now it properly matches the behaviour of the keyboard. :)
    X Axis.gif

    Also – if I understand correctly – the Invert processor isn't meant to reverse the whole input, only to change [0..1] scale to [0..-1] for a single button, so you can use it as a negative direction – right? So when applied to a single side, it shouldn't change the whole composite axis.
    Otherwise, this problem could be solely my fault for mixing Axis action type, Invert and 1D Axis Composite in weird combinations.

    This is the result of experimenting with various settings for gamepads.
    Movement (Axis action type):
    1. Composite 1D Axis (no Invert processor)
      • Negative leftStick/left: always 0
      • Positive leftStick/right: 0 to 1
        No Invert.gif
    2. Composite 1D Axis (+ Invert processor only on "negative")
      • Negative leftStick/left: 0 to 1
      • Positive leftStick/right: 0 to -1
        With Invert.gif
    3. Composite 1D Axis (right/left swapped, without Invert)
      • Negative leftStick/right: 0 to -1
      • Positive leftStick/left: always 0
        Right to Left.gif
    4. Composite 1D Axis (right/left swapped, + Invert only on "negative")
      • Negative leftStick/right: always 0
      • Positive leftStick/left: always 0
        Right to Left + Invert.gif
     
    Last edited: Mar 25, 2019
  6. Nixaan

    Nixaan

    Joined:
    May 30, 2013
    Posts:
    118
    I have similar problems as Rallix in the Editor (Win10), have not tried a build. 1D Axis Composite doesn't return negative values. And 2D Vector Composite returns wrong values - stick moved up returns x0.7, y0.7; stick moved up-right returns x0, y1, stick centered (or any of the remaining directions) returns x1, y0. No any in between values and no negative values returned. Non composite alternatives work fine.
     
    CaelumCB and Rallix like this.
  7. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    Yes, I can confirm the thing about Composite 2D, too.
    While "Gamepad.current.leftStick.ReadValue()" works fine, Composite 2D (with leftStick/up on Up, leftStick/down on Down etc.) is a bit messed up. Look at the difference between the two approaches:
    Composite2D resized.gif
     
    CaelumCB likes this.
  8. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    Doesn't seem so. At least in the asset file, it's saved with a comma. I was trying to replicate the original "Mouse X/Y" axis which had smaller values than the new mouse delta:

    Code (csharp):
    1. {
    2.     "name": "",
    3.     "id": "9b8e225e-d2b0-46b1-9150-5c0380ceed86",
    4.     "path": "<Mouse>/delta",
    5.     "interactions": "",
    6.     "processors": "Scale(factor=0,05)",
    7.     "groups": ";Keyboard and Mouse",
    8.     "action": "Mouse",
    9.     "chainWithPrevious": false,
    10.     "isComposite": false,
    11.     "isPartOfComposite": false,
    12.     "modifiers": ""
    13. }
    which throws an exception (Unity 2019.1.0b7 / Input System 0.2.6):

    Code (csharp):
    1. Exception while resolving binding 'Mouse:<Mouse>/delta[;Keyboard and Mouse]' in action map 'Controls (UnityEngine.Experimental.Input.InputActionAsset):Player'
    2. UnityEngine.Experimental.Input.InputActionMap:Enable()
    Code (csharp):
    1. Exception: Cannot find public field 05 in ScaleProcessor (referenced by parameter)
    2. UnityEngine.Experimental.Input.Layouts.InputDeviceBuilder.SetParameters (System.Object onObject, UnityEngine.Experimental.Input.Utilities.ReadOnlyArray`1[TValue] parameters) (at Library/PackageCache/com.unity.inputsystem@0.2.6-preview/InputSystem/Devices/InputDeviceBuilder.cs:890)
    3. UnityEngine.Experimental.Input.InputBindingResolver.ResolveProcessors (System.String processorString) (at Library/PackageCache/com.unity.inputsystem@0.2.6-preview/InputSystem/Actions/InputBindingResolver.cs:613)
    4. UnityEngine.Experimental.Input.InputBindingResolver.AddActionMap (UnityEngine.Experimental.Input.InputActionMap map) (at Library/PackageCache/com.unity.inputsystem@0.2.6-preview/InputSystem/Actions/InputBindingResolver.cs:242)
    5. UnityEngine.Experimental.Input.InputActionMap:Enable()
    When I edit the factor directly in the file and change the comma to a period, the exception is gone, but the Scale processor still doesn't seem to be working, so I ended up dividing the read value in code.
     
  9. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Yup, the code was indeed not handling locales correctly. Should be fixed here and be included in the next package.

    Still digging through the rest here :)
     
    Rallix likes this.
  10. ElcolED

    ElcolED

    Joined:
    Aug 13, 2014
    Posts:
    2
    I'm using Unity 2019.1.1f1 with the Input System 0.2.8...

    having the same problem, hold returns performed immediately after start, no matter the time
     
  11. Win3xploder

    Win3xploder

    Joined:
    Dec 5, 2014
    Posts:
    159
    @Rene-Damm I'm also having problems with the input system setting my decimal inputs for processors and interactions back to 0 - and getting (0.7, 0.7) as a result from a d-Pad.

    I would also like to give some feedback regarding the input reading system. I am really missing a function that lets me read the current state of an input instead of only being given the event when the input fires. This necessitates a lot of extra code to handle the input state when .performed is not being fired.

    Is there a best practice example I can look at?
     
  12. Win3xploder

    Win3xploder

    Joined:
    Dec 5, 2014
    Posts:
    159
    @Rene-Damm When are these bugs going to be fixed?
     
  13. frostymm

    frostymm

    Joined:
    Jun 21, 2013
    Posts:
    34
    I'm currently having an issue where when pushing various directions rapidly, sometimes they never call the cancelled phase event so my character just runs on forever despite not touching any buttons. I've gotten it to happen somewhat consistently by pressing all the wasd keys and then letting them all go at the same time. It's weird though, if I pause and play again, the event fires.

    Has anyone else had this issue? My apologies if this was listed above, I didn't see it.

    I'm currently on 2019.1.4f1
    Input system 0.2.10
     
  14. Win3xploder

    Win3xploder

    Joined:
    Dec 5, 2014
    Posts:
    159
    @Rene-Damm I downloaded the latest update and some of the issues are fixed :) But now I can't seem to make my input C# class public. (doesnt show in the inspector)
     
  15. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    I've been getting this error for a while...

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.SettingsProvider.Repaint () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Settings/SettingsProvider.cs:123)
    3. UnityEngine.InputSystem.Editor.InputSettingsProvider.ForceReload () (at /Volumes/XYZ/Unity/Custom Packages/InputSystem/Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs:356)
    4. UnityEngine.InputSystem.InputSystem.OnProjectChange () (at /Volumes/XYZ/Unity/Custom Packages/InputSystem/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs:1682)
    5. UnityEngine.InputSystem.LowLevel.NativeInputRuntime.OnProjectChanged () (at /Volumes/XYZ/Unity/Custom Packages/InputSystem/Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs:228)
    6. UnityEditor.EditorApplication.Internal_CallProjectHasChanged () (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:345)
    in 2019.2.0b4 &b5

    EDIT: This seems to be triggered by any change in the Input System Package settings in Project settings.
     
    Last edited: Jun 18, 2019
    myanko likes this.
  16. Rallix

    Rallix

    Joined:
    Mar 17, 2016
    Posts:
    139
    I'll just want to put a little update here on some of the problems.
    In the newest version of Input System, with the "self-contained" wrapper:
    – the controls no longer randomly disable themselves when the scene is reloaded
    – input in WebGL works for me again
    So, at least for me, the major two issues I had are no longer a problem.
     
  17. Elhimp

    Elhimp

    Joined:
    Jan 6, 2013
    Posts:
    75
    Okay, right now Input System went almost sillent. Again. In debug view I see events happening, yet device variables completely frozen. Restarting editor and reinstalling Input System from scratch doesn't helped a bit. And what bothers me most, I got no idea how to reproduce this...

    Only idea is, I've tried to get "Handle is not allocated" error two days ago, which is obviously messes up with memory... but two days of a reaction time? Nope.

    So, reboot is seems only option to fix this. Okay. But why this happening?

    Upd: I was a little bit hasty writing about it and not googling. So if anyone interested / having same issue, here it is: https://github.com/Unity-Technologies/InputSystem/issues/607
    Yet, not a single clue "why?"
     
    Last edited: Jun 10, 2019
    Skuxlife likes this.
  18. Win3xploder

    Win3xploder

    Joined:
    Dec 5, 2014
    Posts:
    159
    The input system doesn't recognize float values from my x360 gamepad. Also, it seems to totally ignore input from the sticks that is left or down. (using the listening function in the Path field returns nothing when tilting the left stick to the left or downwards) This is on version 0.2.10
     
  19. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    I'm trying to build on iOS but the app crashes after the logos. Xcode points to the return at the end of this code...

    Code (CSharp):
    1. // System.Void* UnityEngine.InputSystem.LowLevel.InputStateBuffers_DoubleBuffers::GetFrontBuffer(System.Int32)
    2. IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void* DoubleBuffers_GetFrontBuffer_mE534D7CDE9DC24C1F08B5B2298B8D548A44E9B82 (DoubleBuffers_t2AE9E33A12B07CE51EFCA40422A9ACB619F7DA69 * __this, int32_t ___deviceIndex0, const RuntimeMethod* method)
    3. {
    4.     {
    5.         void** L_0 = __this->get_deviceToBufferMapping_0();
    6.         int32_t L_1 = ___deviceIndex0;
    7.         uint32_t L_2 = sizeof(void*);
    8.         return (void*)((*((intptr_t*)((void**)il2cpp_codegen_add((intptr_t)L_0, (intptr_t)((intptr_t)il2cpp_codegen_multiply((intptr_t)(((intptr_t)((int32_t)il2cpp_codegen_multiply((int32_t)L_1, (int32_t)2)))), (int32_t)L_2)))))));
    9.     }
    10. }
    This is with Unity 2019.2.0b5. Using the develop branch of the Input System. Any idea what might be going wrong (aside from the fact I'm using a beta version of Unity and an unstable branch? :) )
     
  20. myanko

    myanko

    Joined:
    Nov 9, 2013
    Posts:
    56
    I'm getting the same problem and it make shader graph stop to work.

    Windows 10
    Version 2019.2.0b5 (e3a10156d6de) Personal

    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.ads": "2.0.8",
    4.     "com.unity.analytics": "3.3.2",
    5.     "com.unity.cinemachine": "2.3.4",
    6.     "com.unity.collab-proxy": "1.2.16",
    7.     "com.unity.formats.fbx": "2.0.1-preview.11",
    8.     "com.unity.ide.rider": "1.0.4",
    9.     "com.unity.ide.visualstudio": "1.0.5",
    10.     "com.unity.ide.vscode": "1.0.4",
    11.     "com.unity.inputsystem": "0.2.10-preview",
    12.     "com.unity.package-manager-ui": "2.2.0",
    13.     "com.unity.probuilder": "4.0.5",
    14.     "com.unity.purchasing": "2.0.6",
    15.     "com.unity.quicksearch": "1.2.4-preview",
    16.     "com.unity.render-pipelines.high-definition": "6.7.1-preview",
    17.     "com.unity.textmeshpro": "2.0.1",
    18.     "com.unity.timeline": "1.1.0",
    19.     "com.unity.modules.ai": "1.0.0",
    20.     "com.unity.modules.animation": "1.0.0",
    21.     "com.unity.modules.assetbundle": "1.0.0",
    22.     "com.unity.modules.audio": "1.0.0",
    23.     "com.unity.modules.cloth": "1.0.0",
    24.     "com.unity.modules.director": "1.0.0",
    25.     "com.unity.modules.imageconversion": "1.0.0",
    26.     "com.unity.modules.imgui": "1.0.0",
    27.     "com.unity.modules.jsonserialize": "1.0.0",
    28.     "com.unity.modules.particlesystem": "1.0.0",
    29.     "com.unity.modules.physics": "1.0.0",
    30.     "com.unity.modules.physics2d": "1.0.0",
    31.     "com.unity.modules.screencapture": "1.0.0",
    32.     "com.unity.modules.terrain": "1.0.0",
    33.     "com.unity.modules.terrainphysics": "1.0.0",
    34.     "com.unity.modules.tilemap": "1.0.0",
    35.     "com.unity.modules.ui": "1.0.0",
    36.     "com.unity.modules.uielements": "1.0.0",
    37.     "com.unity.modules.umbra": "1.0.0",
    38.     "com.unity.modules.unityanalytics": "1.0.0",
    39.     "com.unity.modules.unitywebrequest": "1.0.0",
    40.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    41.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    42.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    43.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    44.     "com.unity.modules.vehicles": "1.0.0",
    45.     "com.unity.modules.video": "1.0.0",
    46.     "com.unity.modules.vr": "1.0.0",
    47.     "com.unity.modules.wind": "1.0.0",
    48.     "com.unity.modules.xr": "1.0.0"
    49.   }
    50. }
    51.  
     
  21. Th0re

    Th0re

    Joined:
    Sep 4, 2015
    Posts:
    39
    Can confirm, I have the same issue.
     
  22. Th0re

    Th0re

    Joined:
    Sep 4, 2015
    Posts:
    39
    Another (potential) bug: the default path to generate the C# is incorrect. It creates an asset folder within the asset folder.
     
  23. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    In editor `SetMotorSpeeds()` works for a few sec then turns off. Is that intended to prevent overheating?
    Code (CSharp):
    1. if (GUILayout.Button("Start Motors"))
    2. {
    3.     InputSystem.GetDevice<Gamepad>().SetMotorSpeeds(0.3f, 0.6f);
    4. }
    Also, a space is created by default in C# Class File name if asset itself has a space in its name.
    upload_2019-9-25_18-41-45.png
     
  24. EmurKun

    EmurKun

    Joined:
    Oct 3, 2017
    Posts:
    4
    Hi, I don't know why I can't bind the "Right Stick" when I first bind the "Left Stick" and also when I bind the "Right Stick" first, it also happens in the "Left Stick", I can't bind both of them at the same time. I watched Brackeys's video on the new Input System it seems he can bind both at the same time. I am using the 1.0.0 version and for my controller I use a PS4 controller.
    upload_2019-10-20_23-29-7.png
     
  25. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Yes. Different devices/drivers/APIs have different tolerances and behaviors here but especially when rumbled at max frequency, gamepads will generally turn off after a while.

    What't the action type (and control type) for "Rotate"? Judging from the control picker, Vector2 controls are not compatible with the action and thus get filtered out (this is why it's grayed out).
     
    PixelLifetime likes this.
  26. unity_w8ufth3X_pR_Sg

    unity_w8ufth3X_pR_Sg

    Joined:
    Oct 7, 2019
    Posts:
    2
    Hello Everyone,

    I am trying right now to control a simple gameobject with samsung GamePad. Unity detects it and i can test it in the unity editor and it works ok. But i want to deploy this App on the Hololens. I am using Unity 2019.2.11f1 with the input System 1.0.0.0. I can not even build the app, i get those errors in the screenshot. I think that comes from the Input System, because before i upload the input system , i could build my apps and play them on the hololens.

    Who has a solution and could help me out ?

    Thank y'all
     

    Attached Files:

  27. EnkHeart

    EnkHeart

    Joined:
    Apr 5, 2019
    Posts:
    5
    New Bug @ Unity-2019-LTS with NewInputSystem 1.0.0: Joystick/Gamepad values are wrong. 0/0 will be -0.2,0,2.
    Setting a deathzone will not work. This behaviour is the same like the old Unity version with no LTS and the new Input system 1.0.0.

    Controller: "Sony Interactive Entertainment Controller" => PS Classic Controller connected with USB.
    The controller has no real Axis. It has a DPAD that works like an Axis. The Controller works great in Windows>Gamepads>Info, in the old Input-System (Horizontal/Vertical Axes) and with Daemon3000 Custom Input Manger (https://github.com/daemon3000/InputManager).

    However. The "New Input System" detects the gamepad in "Windows > Analysis > Input Debugger" correctly.
    Here you can see, that the 0/0 values of the DPAD (WITH NO INPUTS) has -0.2 and 0.2. In the Old Input-Mangager this is 0/0.
    Also If I take inputs, the values are not correct:

    DPAD LEFT = -1.0/0.2 => should be -1/0
    DPAD RIGHT = 0.5/0.2 => should be 1/0
    DPAD UP = -0.2/1.0 => should be 0/1
    DPAD DOWN = -0.2/-1.0 => should be 0/-1

    DPAD UP LEFT = -0.7/0.7 => should be -1/1
    DPAD UP RIGHT = 0.4/0.9 => should be 1/1
    DPAD DOWN LEFT = -0.9/-0.4 => should be -1/-1
    DPAD DOWN RIGHT = 0.5/-0.5 => should be 1/-1

    If anybody has this controller, please reproduce it. I dont know how to fix this behaviour.
    Imagine, that a player connects this gamepad and his player avatar will be moving wrong. What will the player think about the game?

    edit: typo
     

    Attached Files:

    Last edited: Jun 10, 2020
  28. martt_1er

    martt_1er

    Joined:
    Mar 9, 2015
    Posts:
    6
    Hi

    I'm facing a very - very strange bug with input system and I wonder if it is a known one.

    When I focus on another app, then I focus again on my game with Cmd-TAB (i'm on a mac), the input system automatically and wrongly detects the A-key pressed!
    Even stranger, the problem does not happen if I focus back the game using the mouse. Only with Cmd-TAB!
    It happens either on editor and on a macos build.
    If I bind my control with another key (left arrow key or whatever), the problem does not happen.

    Here's my configuration:
    - iMac, Catalina (happened on previous os too)
    - Unity 2019.3.14f1
    - Input System 1.0.0 (from April 29th)
    - french Keyboard (but happen too when configuring my layout as english one)
    - the "A" key (not happening if I configure another key to this command)

    The bug happen with all the input detection strategies: C# events, Unity events, method broadcasts, etc...

    I even tried this in Update method :

    Code (CSharp):
    1. if (controls.Player.myCommand.ReadValue<float>() != 0) {
    2.     Debug.Log("Key is down!");
    3. }
    and, when I focus back to my game with Cmd-TAB, "Key is down!" is continuously written in logs...

    Finally, when the bug is happening, I have to really press the A key and release it to restore the state.
     
    MollySpryFox, Kelevra and ModLunar like this.
  29. ModLunar

    ModLunar

    Joined:
    Oct 16, 2016
    Posts:
    374
    @martt_1er Perhaps the same/similar issue -- I've been dealing with it telling me my Jump key is pressed when my hands were nowhere even near the keyboard at all.
    Most of the time for me, this happens at the beginning of playmode in the Unity editor.

    It's very frustrating cause my player just keeps jumping randomly...
    It's been like this for months, I should really submit a bug report when I get some time.
     
  30. Kelevra

    Kelevra

    Joined:
    Dec 27, 2012
    Posts:
    87
    @Rene-Damm Hello! I have the same issue as @martt_1er
    The issue can be seen if you just open keyboard input debugger:
    1. CMD doesn't release if you switch between different full screen/another desktop applications. After switching back to the Unity you will see the state inversion. 1 - when unpressed, 0 - when pressed
    2. Don't know why but after several switches A key marked as pressed and released only after pressing A second time.

    Unity 2020.1.0f, InputSystem 1.0.0 (April 29)
    Mac OS Catalina 10.15.5

    UPD:
    100% reproducible with Cmd+Shift+4 hot key. Steps:
    1. Open Keyboard Debug window
    2. Press Cmd + Shift + 4
    3. Press Esc
    4. Check that Cmd and Shift - are in the inversed state (1 - unpressed, 0 - pressed) and A marked as pressed.
     
    Last edited: Aug 4, 2020
    MollySpryFox and ModLunar like this.
  31. Kelevra

    Kelevra

    Joined:
    Dec 27, 2012
    Posts:
    87
    Last edited: Aug 6, 2020
    ModLunar likes this.
  32. Inkleth

    Inkleth

    Joined:
    Jun 22, 2019
    Posts:
    1
    Ok so I got a weird one for ya.

    I currently have a PlayerInputs component set to Send Messages on each game object with a script that references inputs. OnMove, OnLook, OnJump, OnShoot, etc. That old chesnut.

    My default Action Map has each entry bound to a Gamepad input and a Keyboard input since its single player & I want people to use the input they prefer.

    I'm having 2 major bugs right now.

    1.
    If I connect my game pad via blue tooth or run DS4 in the background (its spoofs a ps4 controller to look like an XBOX one on windows) the game flips the F*** out. I assume because it thinks its getting the same input from several sources, although that doesn't explain why it will fire off commands for buttons I'm not even hitting. But whatever, big deal, I usually play with my controller plugged in anyway because who needs to be that far away if your playing on a laptop.

    2.
    The really weird issue I'm having however is this;
    I have my SwapWeapon & SwapToHeavyWeapon mapped to the same button, One gets triggered on a tap the latter gets triggered when you hold the button down ala destiny. Using the Keyboard inputs this all runs swell.
    However,
    For some weird reason when I use my game pad the SwapToHeavyWeapon method only gets called once, the first time I press it. Anytime after that it's totally unresponsive even if I try hitting it's keyboard equivalent.
    The only way I've found to fix this is by unplugging the game pad and jamming it back in again witch is obviously not feasible.

    If any of y'all have any insight into this I'd be greatly appreciated. I hate to have to give up on my favorite control scheme over this.
     
    MollySpryFox and ModLunar like this.
  33. MollySpryFox

    MollySpryFox

    Joined:
    May 4, 2020
    Posts:
    11
    I have a the same problems as @martt_1er, @Kelevra where in the mac editor Cmd+Tabbing back into the editor will make the keyboard device report A is pressed.

    A temporary work around I have in my update loop where I just disable the control if Application.isFocused is false. But even that has problems.
    This prevents an a key press from happening on the command I'm listening to, but has a very strange side effect where the next time I press Cmd that also reads as an "A" key keyboard press and triggers the binded actions. This also doesn't help with the screen recorder.

    EDIT: bug report: https://issuetracker.unity3d.com/is...-when-taking-a-screenshot-with-built-in-tools
     
    Last edited: Sep 29, 2020
  34. McPeppergames

    McPeppergames

    Joined:
    Feb 15, 2019
    Posts:
    103
    I am testing the new input system and strangely have situations with the Unity PlayerController and WASD keys: Somehow when a key is pushed the character often get "stuck" in his running state (running in one direction), even when the key is not getting pushed anymore. This is not happening all the time but very often.
    Is there a known "bug" in the code or does anybody have a sample code which is not having problems?
     
    GoodArcade likes this.
  35. AsaBattle

    AsaBattle

    Joined:
    Jan 3, 2017
    Posts:
    7
    Hey I'm not sure if you were ever able to fix your issue, but I was/am having the same issue(or at least one that sounds just like yours. Where if I quickly "flick" a joystick on my gamepad in a direction. Sometimes it won't report going back to 0,0, so my space ship continues the action in the "flicked" direction forever. Well, at least until I move that same joystick again) and here is how I solved it.
    Also, I tried messing around with dead zones, but this only made the issue only disappear from the dead zones. Maybe there's a way of solving it that way, but I wasn't able to figure it out.
    Anyway, what I was previously doing was setting up the performed call back on a joystick. Then updating my action with the new value that was passed in. Like this

    gameActions.Player.WeaponsFire.performed += OnWeaponsFireStick;
    ...
    private void OnWeaponsFireStick(InputAction.CallbackContext context)
    {
    // Read in the new joystick aiming/firing direction
    Vector2 tDirection = context.ReadValue<Vector2>();

    }
    ...
    // If the controller's firing stick is being moved, then fire the gun in it's direction
    if (tempFireDirection.x != 0 || tempFireDirection.z != 0)
    {
    myWeapon.Fire(rb.transform.position, new Vector3(tempFireDirection.x, 0, tempFireDirection.y), rb.velocity);
    }

    I realized that to fix this issue, I needed to constantly poll the value of the joystick instead of relying on unity to update me on it's change.
    So here's how I fixed it:

    Inside my player ships Initialization routine
    ...
    gameActions = new GameActions();
    actionArray = gameActions.Player.Movement.actionMap.actions;
    ...

    And inside the player ships update routine

    // Read the value of the firing stick and if it's being moved, then fire the gun in it's direction
    Vector2 tempDirection = actionArray[1].ReadValue<Vector2>();
    if (tempDirection.x != 0 || tempDirection.y != 0)
    {
    myWeapon.Fire(rb.transform.position, new Vector3(tempDirection.x*10f, 0, tempDirection.y*10f), rb.velocity);
    }

    This of course means the joystick is constantly being polled, which might take up a lot of unnecessary processing, but I'm not sure of a better way of doing this. And this way seems to work exactly as I'd like.
     
    Last edited: Oct 8, 2020
  36. tacman1123

    tacman1123

    Joined:
    Sep 14, 2020
    Posts:
    77
    Using the new Input System, the gamepad works in the editor, but not in the Linux standalone, using x86_64. The keyboard responds as expected.

    When I do a development build and attach it to the Input Debugger, I do see the expected activity when I use the gamepad controls, but the program isn't responding (but again, is to the mouse and keyboard events).

    I've tried in both 2019 and 2020.1, Input System 1.01, Player settings to Input System (new) only (not both).
     
    Last edited: Dec 10, 2020
    chilon likes this.
  37. CISAC9

    CISAC9

    Joined:
    Feb 24, 2018
    Posts:
    9
    The PS4 controller does not work properly with the new Input System. Opening the Input Debugger results in a mess of inputs all being recognised at once without a single button being pressed.
    Pressing the right stick button also makes Unity recognise the input as R2 and pressing R2 just makes it recognise way more buttons than it should.
    Screenshot_170.png Screenshot_171.png

    How do I fix this? I've seen people with the same issue before, but no solution.
    And no, Steam is not running, so the problem cannot be the Steam controller mapping.
    The DualShock4HID configuration is completely wrong and the tutorial Unity has on overriding it is not helpful at all.
     
  38. FrickinSilly

    FrickinSilly

    Joined:
    Feb 19, 2020
    Posts:
    53
    Is there any update on the issue of dropping input on scene loading?

    This is easily reproducible. I hold left or right on the d-pad immediately after pressing play and the character doesn't move (I know focus is on the scene view because I can release and press the same button and the character moves).

    And yes, it happens between two scenes as well.
     
  39. reachdabeach

    reachdabeach

    Joined:
    Jan 28, 2021
    Posts:
    70
  40. Rovnyy-K

    Rovnyy-K

    Joined:
    Apr 19, 2015
    Posts:
    5
    Came up with a workaround.
    Add this code to a persistent MonoBehaviour :


    public void OnApplicationFocus(bool focus)
    {
    if (Keyboard.current!=null)
    InputSystem.TryResetDevice(Keyboard.current);
    }
     
    qingyu527 and MollySpryFox like this.
  41. EnkHeart

    EnkHeart

    Joined:
    Apr 5, 2019
    Posts:
    5
    Its 2021 and Unity 2020.3 LTS are there. The "new Input System" has flaged with Version 1.0.2 "Verified". So I am doing the Playstation-Classic-Controller-Test https://forum.unity.com/threads/input-system-bugs.647611/#post-5963054 again.

    Sadly the test give me the same result: DPAD (WITH NO INPUTS) has X = -0.2 and Y= 0.2.
    With this data the "new Input System" is not "verified" for me, because this controller (Playstation Classic Controller) delivers wrong values in the "new Input System". To be clear: This controller works find in unity "old Input System" and in other games and applications. Also Windows > Gamepads > shows me the correct gamepad values.

    Do not use the "New Input System", because you can not trust the values from it. The "old Input System" works fine.
     
    imaginationrabbit likes this.
  42. GoodArcade

    GoodArcade

    Joined:
    Aug 7, 2013
    Posts:
    7
    I have the same issue...it happens quite frequently for me.
     
    ModLunar likes this.
  43. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Hello there,
    I'm testing a multiplayer prove of concept using PUN2 and the new input system, I have build the game, then executing two instances of the game to test, input from keyboard and mouse is correctly isolated, meaning that when I focus on one of the application instances the input is emitted to that instance, when I focus to the second instance same expected behavior, BUT when using Gamepad, both instances are receiving the input no matter which one had the focus.
    So far I have tried by unchecking "Run in background" since I'm testing outside the Unity Editor, and double checked the Input System Settings Background Behavior->Reset and Disable non Background Devices, but again since it is working fine with Keyboard input, there might be something else.
    This is a PC build, and reproduced the issue from Unity 2019LT to 2021LT
    Input System version: 1.3.0
    Is this a known issue?
     
  44. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Reproduced too by playing the Karts Multiplayer Demo from Exit Games, both instances reacts to the Gamepad input despite one of them not having focus
     
  45. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    @Rusted_Games depends on the gamepad itself, XInput and HID devices go to different code, IIRC HID ones should go to sleep when window loses focus. XInput ones IIRC are marked as background devices and are always active.

    Please report it as a bug, maybe the setting doesn't propagate to the native code.
     
    Rusted_Games likes this.