com.unity.inputsystem 1.1.0-preview.2

com.unity.inputsystem

Notes: processedReleased October 24, 2020

Browse versions

PreviousNext

Unity Compatibility

Minimum Unity: 2019.4

Package Dependencies

No dependency metadata provided.

📈 Improvements

  • The `submit` and the `cancel` actions of the UI input module now trigger on **release** instead of press. This makes the behavior consistent with clicks triggering UI response on release rather than press.
  • Removed the old "Tanks" demo (previously available from the samples shipped with the package).
  • - Added a new and improved demo project, which you can download from the InputSystem\_Warriors GitHub repository.
  • #### Actions
  • Actions of type `InputActionType.Button` now respect button press (and release) points.
  • - Previously, button-type actions, when used without explicit "Press" interactions, would perform immediately when a bound control was actuated.
  • - Now, a button-type action will behave the same as if a "Press" interaction is applied with "Trigger Behavior" set to "Press Only".
  • - This means that a button-type action will now perform (and perform **once** only) when a control crosses the button press threshold defined in the global settings or, if present, locally on a `ButtonControl`. It will then stay performed and finally cancel only when the control falls back to or below the release threshold.
  • `InputAction.ReadValue()` now always returns `default` when the action is canceled.
  • - This is to make it consistent with `InputAction.CallbackContext.ReadValue()` which already returned `default` when the action was canceled.
  • - In general, all APIs that read values will return default values when an action is in a phase other than `Started` or `Performed`.
  • If multiple actions in different action maps but in the same .inputactions asset have the same name, calling `InputActionAsset.FindAction()` with just an action name will now return the first **enabled** action. If none of the actions are enabled, it will return the first action with a matching name as before (case 1207550).
  • ```CSharp
  • var map1 = new InputActionMap("map1");
  • var map2 = new InputActionMap("map2");
  • map1.AddAction("actionWithSameName");
  • map2.AddAction("actionWithSameName");
  • var asset = ScriptableObject.CreateInstance();
  • asset.AddActionMap(map1);
  • asset.AddActionMap(map2);
  • map2["actionWithSameName"].Enable();
  • var action = asset["actionWithSameName"];
  • // Before: "map1/actionWithSameName"
  • // Now: "map2/actionWithSameName"
  • ```

🔧 Bug Fixes

  • Fixed player build causing `ProjectSettings.asset` to be checked out in Perforce (case 1254502).
  • Fixed player build corrupting preloaded asset list in `PlayerSettings` if it was modified by another build processor.
  • Fixed remoting in Input Debugger not working for devices in the player that are created from generated layouts (such as XR devices).
  • Fixed potential `NullReferenceException` in `InputActionProperty` when the `InputActionReference` is `null`.
  • Fixed "On-Screen Controls" sample still using `StandaloneInputModule` and thus throwing `InvalidOperationException` when used with "Active Input Handling" set to "Input System Package (New)" (case 1201866).
  • Fixed `OnScreenButton` leaving button controls in pressed state when disabled in-between receiving `OnPointerDown` and `OnPointerUp`. Usually manifested itself by having to click the button twice next time it was enabled.
  • Fixed exiting out of play mode in the Unity Editor while a test run is in progress leading to the Input System permanently losing all its state until the editor is restarted (case 1251724).
  • Fixed max values for `Axis` and `Double` controls stored as multi-bit fields being off by one (case 1223436).
  • - Fix contributed by jamre in 962. Thank you!
  • Fixed debug assert in `InputDeviceTester` sample when simultaneously pressing two buttons on gamepad (case 1244988).
  • Fixed use of UI `Slider` causing drag thresholds to no longer work (case 1275834).
  • Fixed layout lists in Input Debugger not updating when removing layouts.
  • Fixed device connects leading to different but similar device being reported as reconnected.
  • #### Actions
  • Fixed Action with multiple bindings becoming unresponsive after a Hold interaction was performed (case 1239551).
  • Fixed `NullReferenceException` when `Player Input` component `Create Action` is pressed and saved (case 1245921).
  • Fixed `InputActionTrace.ActionEventPtr.ReadValueAsObject` leading to `InvalidCastException` when trying to read values that came from composite bindings.
  • Fixed not being able to stack a `MultiTap` on top of a `Tap` (case 1261462).
  • Fixed rebinds triggered by the Enter key causing stuck Enter key states (case 1271591).
  • Fixed `Map index on trigger` and `IndexOutOfRangeException` errors when using multiple Interactions on the same Action. (case 1253034).
  • Fixed context menu in action editor not filtering out composites the same way that the `+` icon menu does. This led to, for example, a "2D Vector" composite being shown as an option for a button type action.
  • Fixed initial state checks for composite bindings failing if performed repeatedly. For example, doing a `ReadValue` for a WASD binding would return an incorrect value after disabling the map twice while no input from the keyboard was received (case 1274977).
  • Fixed "Add Interaction" menu in action editor not filtering out interactions with incompatible value types (case 1272772).
  • Fixed `PlayerInput` no longer auto-switching control schemes if `neverAutoSwitchControlSchemes` was toggled off and back on after the component was first enabled (case 1232039).
  • Fixed action map name being the same as .inputactions asset name leading to compile errors when `Generate C# Class` is used; now leads to import error (case 1212052).
  • Fixed bindings not getting updated when binding by display name and there is no control with the given display name initially.
  • ```
  • // If at the time this action is enabled, there's no ä key on the keyboard,
  • // this did not update properly later when switched to a layout that does have the key.
  • var action = new InputAction(binding: "/#(ä)");
  • ```

Features

  • Added tvOS documentation entries in 'Supported Input Devices' page.
  • #### Actions
  • Added "release thresholds" for buttons.
  • - Release points are now separated from press points by a percentage threshold.
  • - The threshold is defined by `InputSettings.buttonReleaseThreshold`.
  • - Thresholds are defined as percentages of press points. A release is thus defined as a button, after having reached a value of at least `InputSettings.defaultButtonPressPoint` (or whatever local press is used), falling back to a value equal to or less than `InputSettings.buttonReleaseThreshold` percent of the press point.
  • - This is intended to solve the problem of buttons flickering around button press points.
  • - The default threshold is set at 75%, that is, buttons release at 3/4 of the press point.
  • Added new methods to the `InputAction` class:
  • - `InputAction.IsPressed()`: Whether a bound control has crossed the press threshold and has not yet fallen back below the release threshold.
  • - `InputAction.WasPressedThisFrame()`: Whether a bound control has crossed the press threshold this frame.
  • - `InputAction.WasReleasedThisFrame()`: Whether a bound control has fallen back below the release threshold this frame.
  • - `InputAction.WasPerformedThisFrame()`: Whether the action was performed at any point during the current frame. Equivalent to `InputAction.triggered`, which will be deprecated in the future.
  • - `InputAction.Reset()`: Forcibly reset the action state. Cancels the action, if it is currently in progress.
  • Added `InputAction.GetTimeoutCompletionPercentage` to query the amount left to complete a currently ongoing interaction.
  • ```CSharp
  • // Let's say there's a hold interaction on a "warp" action. The user presses a button bound
  • // to the action and then holds it. While the user holds the button, we want to know how much
  • // longer the user will have to hold it so that we can display feedback in the UI.
  • var holdCompleted = playerInput.actions["warp"].GetTimeoutCompletionPercentage();
  • ```
  • Added three new binding composite types:
  • - `OneModifierComposite`: This is a generalization of `ButtonWithOneModifier` (which is still available but now hidden from the UI) which also represents bindings such as "SHIFT+1" but now can be used to target bindings other than buttons (e.g. "SHIFT+delta").
  • - `TwoModifiersComposite`: This is a generalization of `ButtonWithTwoModifiers` (which is still available but now hidden from the UI) which also represents bindings such as "SHIFT+CTRL+1" but now can be used to target bindings other than buttons (e.g. "SHIFT+CTRL+delta").
  • - `Vector3Composite`: Works the same way `Vector2Composite` does. Adds a `forward` and `backward` binding in addition to `up`, `down`, `left`, and `right`.