Search Unity

1.0.0-preview.1 now available

Discussion in 'Input System' started by Rene-Damm, Oct 11, 2019.

  1. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Changed
    • Generated action wrappers now won't Destroy the generated Asset in a finalizer, but instead implement IDisposable.
    • Added back XR layouts (except for Magic Leap) that were removed for 1.0-preview.
      • We removed these layouts under the assumption that they would almost concurrently become available in the respective device-specific XR packages. However, this did not work out as expected and the gap here turned out to be more than what we anticipated.
      • To deal with this gap, we have moved the bulk of the XR layouts back and will transition things gradually as support in device-specific packages becomes publicly available.
    Fixed
    • Fixed a bug where the Input Settings Window might throw exceptions after assembly reload.
    • Correctly implemented IsPointerOverGameObject method for InputSystemUIInputModule.
    • Several bugs with layout overrides registered with (InputSystem.RegisterLayoutOverrides).
      • In 1.0-preview, layout overrides could lead to corruption of the layout state and would also not be handled correctly by the various editor UIs.
    • Selecting a layout in the input debugger no longer selects its first child item, too.
    • Fixed XR devices reporting noise as valid user input (should fix problem of control schemes involving VR devices always activating when using PlayerInput).
    • Fixed tap/swipe gesture detection in touch samples.
    Actions
    • Fixed a bug where multiple composite bindings for the same controls but on different action maps would throw exceptions.
    • Fixed anyKey not appearing in control picker for Keyboard.
    • The text on the "Listen" button is no longer clipped off on 2019.3.
    • Controls bound to actions through composites no longer show up as duplicates in the input debugger.
    • Fixed "Create Actions..." on PlayerInput creating an asset with an incorrect binding for taps on Touchscreens.
      NOTE: If you have already created an .inputactions asset with this mechanism, update "tap [Touchscreen]" to "Primary Touch/Tap" to fix the problem manually.
    • Fixed Invoke CSharp Events when selected in PlayerInput not triggering PlayerInput.onActionTriggered.
    • Fixed duplicating multiple items at the same time in the action editor duplicating them repeatedly.
    Added
    • Will now recognize Xbox One and PS4 controllers connected to iOS devices correctly as Xbox One and PS4 controllers.
    • Added a new sample called "Custom Device Usages" that shows how to use a layout override on Gamepad to allow distinguishing two gamepads in bindings based on which player the gamepad is assigned to.
    • Added abstract TrackedDevice input device class as the basis for various kinds of tracked devices.
     
  2. WizByteGames

    WizByteGames

    Joined:
    Mar 28, 2013
    Posts:
    70
    Is it just me or is OnActionTriggered being called twice when a action is Performed/Canceled.
     
  3. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Note that it'll get called corresponding to when InputAction.started/performed/canceled get triggered. So e.g. when an action performs, you will first see a "started" and then a "performed". The call sequence should be the same as when using "Invoke Unity Events".
     
  4. WizByteGames

    WizByteGames

    Joined:
    Mar 28, 2013
    Posts:
    70
    Yeah I understand that but when I check to see if the phase is Performed/Canceled it gets called twice for each it seems.
     
  5. WizByteGames

    WizByteGames

    Joined:
    Mar 28, 2013
    Posts:
    70
    Oh I see what was wrong. Apparently when I updated My actions didn't have the buttons set to Press Only
     
  6. Jichaels

    Jichaels

    Joined:
    Dec 27, 2018
    Posts:
    237
    Yeah ! Good job guys, keep up the good work :cool:
     
  7. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,255
    When updating an existing project from 1.0.0 - preview to 1.0.0 - preview.1 I get the following:

    Code (CSharp):
    1. UnauthorizedAccessException: Access to the path "[myfoldername]\Assets\Samples\Input System\1.0.0-preview\Simple Demo\SimpleControls.cs" is denied.
    2. System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    3. System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    4. (wrapper remoting-invoke-with-check)
    5. ...
    6. UnityEngine.InputSystem.Editor.InputActionCodeGenerator.GenerateWrapperCode (System.String filePath, UnityEngine.InputSystem.InputActionAsset asset, UnityEngine.InputSystem.Editor.InputActionCodeGenerator+Options options) (at Library/PackageCache/com.unity.inputsystem@1.0.0-preview.1/InputSystem/Editor/AssetImporter/InputActionCodeGenerator.cs:361)
    7. UnityEngine.InputSystem.Editor.InputActionImporter.OnImportAsset (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at Library/PackageCache/com.unity.inputsystem@1.0.0-preview.1/InputSystem/Editor/AssetImporter/InputActionImporter.cs:173)
    8.  
    Needed to delete Samples\Input System to resolve
     
  8. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Which version of Unity are you using? The package samples mechanism had a bug where samples would get installed read-only which can then trigger that error because the system can't re-generate the given C# file. IIRC this is actually present on all released 2019.1 and 2019.2 versions. It's fixed in 2019.3.
     
  9. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,255
    I was initially testing the upgrade on 2019.1.0f2. On newer versions I deleted samples first to avoid issue. So, yes, I would have run into this problem on 2019.1.
     
  10. io-games

    io-games

    Joined:
    Jun 2, 2016
    Posts:
    104
    Is there any mechanism to update actions files?

    I deleted c# generated file, but it does not help, because it still generates c# class with old methods
    Code (CSharp):
    1.  error CS1061: 'InputActionAsset' does not contain a definition for 'GetActionMap'
    UPD
    Manually fixed files to let Unity compile code. Than regenerate c# class, now it generates correct.
    But getting new error:
    Code (CSharp):
    1. Cannot find control layout 'NPad'
    Will try to fix manually

    UPD 2
    Fixed manually by editing files and deleting NPad and XRController bindings

    I would prefer to use migration in future ;)
     
    Last edited: Oct 18, 2019
    Iron-Warrior likes this.
  11. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    There is but it seems to not be working. There's an open bug ATM.

    In principle, this is supposed to be handled automatically by Unity's import pipeline. We bump the importer version, Unity realizes the asset needs to be reimported, it does so and as a side-effect the .cs file gets re-generated and recompiled.

    In practice, something is making this not work. My assumption is that our code-generation-as-a-side-effect is throwing a wrench into this mechanism but haven't taken a closer look yet.

    But yeah, unfortunately, right now if we make a change that breaks existing generated code, everyone using the feature then runs into manually having to trick the pipeline into updating its inputs. Not ideal... :/
     
  12. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    155
    Is there away to keep the generated C# in the InputActionAsset itself? Or is that just not a feature within unity?
     
    Onigiri likes this.
  13. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
  14. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,066
    Submitted two new bug reports today, with 1.0.0-preview.1:
    - Case 1192972: Exception after removing an action callback during the callback
    - Case 1193017: Crash on quit in player when using SetLightBarColor

    Haven't heard back from this issue reported a while back, still happens with 1.0.0-preview.1:
    - Case 1187163: AddDevice throws if there's a binding with an empty string as path (e.g. when unbound via an override)
     
  15. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Unfortunately, not as of today. The current asset pipeline simply isn't set up for this. Could be that it becomes possible at some point with the new asset pipeline.

    Thank you for filing the issues. We'll have a look. (and yup, just a moment ago had 1187163 in front of me)
     
  16. bhavesh_s

    bhavesh_s

    Joined:
    Mar 13, 2018
    Posts:
    1
    I have updated Input System to latest version 1.0.0-1
    SimpleDemo_UsingPlayerInput is not working with gamepads in preview update 1.0.0-1. while it was working in the previous version.
     
  17. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Fix pending. Expected to be in 1.0.0-preview.2.

    Do you happen to have the "CustomDeviceUsages" sample installed in your project? Looking into this one, I found that a very specific bug was surfaced from that combination (which is likely why our QA didn't catch it). Fix is pending here. Expected to be in 1.0.0-preview.2.
     
  18. Awarisu

    Awarisu

    Joined:
    May 6, 2019
    Posts:
    215
    1) Passivation is a chemical process where you coat a material with another, please try and break the Unity tradition of sloppy naming and rename PassivateInput to DeactivateInput

    2) Disable domain/scene reload, enter and leave play mode, enter play mode again, provide some input, and you'll get tons of exceptions
     
    Karxan likes this.
  19. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,066
    Great!

    Just came across another issue, where TouchControl.tapCount would immediately reset to 0 in iOS builds. Reported as Case 1194636.

    Digging around, it seems that the issue comes from the offset being added instead of subtracted on this line:
    https://github.com/Unity-Technologi...putsystem/InputSystem/State/InputState.cs#L33
    Tough, it's a bit confusing what the offset is relative to, Input System time or Unity time…