Skip to content

Commit c90e7fb

Browse files
committed
Merge branch 'docs-processors' of https://github.com/Unity-Technologies/InputSystem into docs-processors
2 parents 58d212b + 542f977 commit c90e7fb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ uid: input-system-processors
55

66
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.
77

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).
910
1011
## Using Processors
1112

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.
1314

1415
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.
1516

@@ -81,14 +82,14 @@ Normalized input is particularly useful in scenarios where the specific magnitud
8182

8283
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.
8384

84-
![This picture shows a player moving forward while the On-Screen control stick was moved up slightly](./Images/Processors-Normalize-Slow.png)
85-
![This picture shows a player moving forward while the On-Screen control stick was moved all the way up](./Images/Processors-Normalize-Fast.png)
85+
![A player moves forward while the on-screen control stick is slightly pushed up.](./Images/Processors-Normalize-Slow.png)
86+
![A player moves forward while the on-screen control stick is moved all the way up](./Images/Processors-Normalize-Fast.png)
8687

8788
In the images shown above, the player moves forward at a constant speed, regardless of how far the joystick is pushed upward.
8889

8990
To apply the Processor, add it to the Binding, as shown in the image below.
9091

91-
![This picture shows the setup of a Normalize Vector 2 Processor in the Input Action Asset Editor](./Images/Processors-NormalizeAsset.png)
92+
![An example of a Normalize Vector 2 Processor setup in the Input Action Asset Editor](./Images/Processors-NormalizeAsset.png)
9293

9394
>__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.
9495
@@ -102,12 +103,12 @@ This allows you to assign weight to input values, which can, for example, make a
102103
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.
103104
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:
104105

105-
![This picture shows the setup of a Scale Vector 2 Processor in the Input Action Asset Editor](./Images/Processors-Scale-Look.png)
106+
![An example of a Scale Vector 2 Processor setup in the Input Action Asset Editor](./Images/Processors-Scale-Look.png)
106107

107108
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.
108109

109-
![This picture shows the setup of a Scale Vector 2 Processor in the Input Action Asset Editor](./Images/Processors-Scale-Look-Pointer.png)
110-
![This picture shows the setup of a Scale Vector 2 Processor in the Input Action Asset Editor](./Images/Processors-Scale-Look-Stick.png)
110+
![An example of a Scale Vector 2 Processor setup in the Input Action Asset Editor](./Images/Processors-Scale-Look-Pointer.png)
111+
![An example of a Scale Vector 2 Processor setup in the Input Action Asset Editor](./Images/Processors-Scale-Look-Stick.png)
111112

112113
>__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.
113114
@@ -124,7 +125,7 @@ The specified minimum value can filter out small movements or noise from the con
124125

125126
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:
126127

127-
![This picture shows the setup of a Stick Deadzone Processor in the Input Action Asset Editor](./Images/Processors-Deadzone-Editor.png)
128+
![An example of a Stick Deadzone Processor setup in the Input Action Asset Editor](./Images/Processors-Deadzone-Editor.png)
128129

129130
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).
130131

@@ -139,6 +140,6 @@ The [Clamp Processor](ProcessorTypes.md#clamp) clamps the input value to a speci
139140
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.
140141
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.
141142

142-
![This picture shows the setup of a Clamp Processor in the Input Action Asset Editor](./Images/Processors-Clamp-Editor.png)
143+
![An example of a Clamp Processor setup in the Input Action Asset Editor](./Images/Processors-Clamp-Editor.png)
143144

144145
>__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

Comments
 (0)