Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Rebinding doesn't work?

Discussion in 'New Input System' started by matijas_05, Feb 5, 2019.

  1. matijas_05

    matijas_05

    Joined:
    May 8, 2017
    Posts:
    6
    Lately I've been prototyping a new way to rebind keys using the new input system and I think I've encoutered a bug. Running this code:
    actionReference.action.ApplyBindingOverride(0, "<Keyboard>/u");
    throws an assertion failed exception:

    Code (CSharp):
    1. Assertion failed
    2. UnityEngine.Experimental.Input.InputActionRebindingExtensions:ApplyBindingOverride(InputAction, Int32, String)
    3. [...]
    Here is the picture of the binding that I'm trying to rebind.
    Adnotacja 2019-02-05 170905.jpg
     
  2. DavidGrof

    DavidGrof

    Joined:
    Sep 13, 2016
    Posts:
    17
  3. DavidGrof

    DavidGrof

    Joined:
    Sep 13, 2016
    Posts:
    17
    Think it will be faster if we manually update the json :p
     
  4. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    459
    Have trouble reproducing this. @matijas_05 Could you paste me the full text from the Editor.log when you encounter the problem? There should have a full stack trace along with the assert.
     
  5. matijas_05

    matijas_05

    Joined:
    May 8, 2017
    Posts:
    6
    Of course.

    Code (CSharp):
    1. Assertion failed
    2. UnityEngine.DebugLogHandler:Internal_Log()
    3. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    4. UnityEngine.Logger:Log(LogType, Object)
    5. UnityEngine.Debug:Assert(Boolean)
    6. UnityEngine.Experimental.Input.InputActionMap:InvalidateResolvedData() (at Library\PackageCache\com.unity.inputsystem@0.1.2-preview\InputSystem\Actions\InputActionMap.cs:697)
    7. UnityEngine.Experimental.Input.InputActionRebindingExtensions:ApplyBindingOverride(InputActionMap, Int32, InputBinding) (at Library\PackageCache\com.unity.inputsystem@0.1.2-preview\InputSystem\Actions\InputActionRebindingExtensions.cs:163)
    8. UnityEngine.Experimental.Input.InputActionRebindingExtensions:ApplyBindingOverride(InputAction, Int32, InputBinding) (at Library\PackageCache\com.unity.inputsystem@0.1.2-preview\InputSystem\Actions\InputActionRebindingExtensions.cs:94)
    9. UnityEngine.Experimental.Input.InputActionRebindingExtensions:ApplyBindingOverride(InputAction, Int32, String) (at Library\PackageCache\com.unity.inputsystem@0.1.2-preview\InputSystem\Actions\InputActionRebindingExtensions.cs:108)
    10. Game.NewInputSystem.KeyBinding:AssignCompositeControl(Int32) (at Assets\_Scripts\Key Bindings\KeyBinding.cs:405)
    11. UnityEngine.Events.InvokableCall`1:Invoke(Int32) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:207)
    12. UnityEngine.Events.UnityEvent`1:Invoke(Int32) (at C:\buildslave\unity\build\Runtime\Export\UnityEvent_1.cs:58)
    13. Game.UI.ArrowSelection:NextOption() (at Assets\_Scripts\UI\ArrowSelection.cs:46)
    14. UnityEngine.Events.InvokableCall:Invoke() (at C:\buildslave\unity\build\Runtime\Export\UnityEvent.cs:166)
    15. UnityEngine.Events.UnityEvent:Invoke() (at C:\buildslave\unity\build\Runtime\Export\UnityEvent_0.cs:58)
    16. UnityEngine.UI.Button:Press() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Button.cs:66)
    17. UnityEngine.UI.Button:OnPointerClick(PointerEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Button.cs:108)
    18. UnityEngine.EventSystems.ExecuteEvents:Execute(IPointerClickHandler, BaseEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:50)
    19. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\ExecuteEvents.cs:261)
    20. UnityEngine.EventSystems.StandaloneInputModule:ProcessMousePress(MouseButtonEventData) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:613)
    21. UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent(Int32) (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:510)
    22. UnityEngine.EventSystems.StandaloneInputModule:ProcessMouseEvent() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:490)
    23. UnityEngine.EventSystems.StandaloneInputModule:Process() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\InputModules\StandaloneInputModule.cs:254)
    24. UnityEngine.EventSystems.EventSystem:Update() (at C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\EventSystem\EventSystem.cs:377)