You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,13 +42,13 @@ The [Invert Processor](ProcessorTypes.md#invert) inverts input values of any typ
42
42
43
43
To use an axis control to mimic a ship's rudder, inverting the input produces the desired effect. Pulling left steers the ship right, and vice versa.
44
44
45
-

46
-

47
-

45
+

46
+

47
+

48
48
49
49
This can be achieved by using an Invert Processor on the Action or the Binding. In this scenario, the Processor is applied to the Binding. Note that inversion is enabled for the X axis but not for the Y axis. Inverting the Y axis would cause the ship to move backward when the joystick is pulled upward. The following image shows the setup in the Action Asset Editor.
50
50
51
-

51
+

52
52
53
53
Finally, attach the following script to a GameObject with a PlayerInput component that references the corresponding Action Asset:
54
54
@@ -81,8 +81,8 @@ Normalized input is particularly useful in scenarios where the specific magnitud
81
81
82
82
To ensure the player always moves at a constant speed where the input simply triggers the action and controls the direction, the Normalize Processor is a suitable choice. This is achieved by retrieving the input vector while ignoring its magnitude and focusing solely on its direction.
83
83
84
-

85
-

84
+

85
+

86
86
87
87
In the images shown above, the player moves forward at a constant speed, regardless of how far the joystick is pushed upward.
88
88
@@ -102,12 +102,12 @@ This allows you to assign weight to input values, which can, for example, make a
102
102
To make the look-around movement smoother and improve ease of use, it may be helpful to reduce the vertical rotation and scale the input values for horizontal rotation. For in-game landscapes that are primarily horizontally aligned, this is a useful feature to prevent the camera from rotating vertically too quickly or in unintended ways.
103
103
To apply this effect to all bindings, the Processor is applied to the Action itself (Look in this scenario). The following image shows the setup using the Starter Assets example:
104
104
105
-

105
+

106
106
107
107
There are two Bindings attached to the Action. The input value ranges of the two bindings are very different. To mitigate this difference, it helps to use a Scale Processor on each of the Bindings. See how the Scale Processor normalizes the input data values for a joystick and a pointer (e.g., a mouse) in the images below.
108
108
109
-

110
-

109
+

110
+

111
111
112
112
Note: This scenario uses the [Starter Assets](https://assetstore.unity.com/packages/essentials/starter-assets-thirdperson-updates-in-new-charactercontroller-pa-196526?srsltid=AfmBOoqLWdW2pU5Wt2reGYdWVodc1e0ko3cBKtfMQuPSgVqmL7yVA3dB), and the included PlayerScript is utilized to rotate the camera.
113
113
@@ -124,7 +124,7 @@ The specified minimum value can filter out small movements or noise from the con
124
124
125
125
The Deadzone Processor can be used to improve accessibility for physically challenging input gestures, such as very small movements on an input device. This can be made configurable through a game menu, for example. To filter out input events from tiny movements on a joystick (e.g., for trembling hands), here’s how the right stick binding of a gamepad can be modified to ignore input events for small input values:
126
126
127
-

127
+

128
128
129
129
The default minimum value is overridden to allow a higher threshold for minimum input values. For the maximum value, the default is used to standardize the values across all gamepads (since not all gamepads may ever send the maximum value).
0 commit comments