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
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,12 @@ uid: input-system-processors
5
5
6
6
An Input Processor takes a value and returns a processed result for it. The received value and result value must be of the same type. For example, you can use a [clamp](#clamp) Processor to clamp values from a control to a certain range.
7
7
8
-
>__Note__: To convert received input values into different types, refer to [composite Bindings](ActionBindings.md#composite-bindings).
8
+
> [!NOTE]
9
+
> To convert received input values into different types, refer to [composite Bindings](ActionBindings.md#composite-bindings).
9
10
10
11
## Using Processors
11
12
12
-
You can install Processors on [bindings](ActionBindings.md), [actions](Actions.md) or on [controls](Controls.md). See[How to apply Processors](HowToApplyProcessors.md) to learn more.
13
+
You can install Processors on [bindings](ActionBindings.md), [actions](Actions.md) or on [controls](Controls.md). Refer to[How to apply Processors](HowToApplyProcessors.md) to learn more.
13
14
14
15
Each Processor is [registered](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterProcessor__1_System_String_) using a unique name. To replace an existing Processor, register your own Processor under an existing name.
15
16
@@ -81,14 +82,14 @@ Normalized input is particularly useful in scenarios where the specific magnitud
81
82
82
83
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
84
84
-

85
-

85
+

86
+

86
87
87
88
In the images shown above, the player moves forward at a constant speed, regardless of how far the joystick is pushed upward.
88
89
89
90
To apply the Processor, add it to the Binding, as shown in the image below.
90
91
91
-

92
+

92
93
93
94
>__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 move the player.
94
95
@@ -102,12 +103,12 @@ This allows you to assign weight to input values, which can, for example, make a
102
103
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
104
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
105
105
-

106
+

106
107
107
108
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
109
109
-

110
-

110
+

111
+

111
112
112
113
>__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
114
@@ -124,7 +125,7 @@ The specified minimum value can filter out small movements or noise from the con
124
125
125
126
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
127
127
-

128
+

128
129
129
130
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).
130
131
@@ -139,6 +140,6 @@ The [Clamp Processor](ProcessorTypes.md#clamp) clamps the input value to a speci
139
140
In a case where the player is not supposed to fall below a certain base speed, but also cannot exceed a certain maximum speed, the Clamp Processor is the one you may want to use.
140
141
In the following image, you can see how a Clamp Processor can be used to restrict input values within a defined minimum and maximum range.
141
142
142
-

143
+

143
144
144
145
>__Note__: The Bindings can contain input values with very different ranges. In that case, a Scale Processor on the Bindings can help preprocess the values before clamping them (Processors on Actions are applied after Processors on Bindings).
0 commit comments