Skip to content

Commit 8472341

Browse files
committed
added scenarios for each processor
1 parent 55f2803 commit 8472341

1 file changed

Lines changed: 40 additions & 2 deletions

File tree

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

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ An Input Processor takes a value and returns a processed result for it. The rece
88
>__Note__: To convert received input values into different types, see [composite Bindings](ActionBindings.md#composite-bindings).
99
1010
* [Using Processors](#using-processors)
11+
* [When to use which Processor](#when-to-use-which-processor)
12+
* [Invert](#invert)
13+
* [Normalize](#normalize)
14+
* [Scale](#scale)
15+
* [Deadzone](#deadzone)
16+
* [Clamp](#clamp)
1117

1218
## Using Processors
1319

14-
You can install Processors on [bindings](ActionBindings.md), [actions](Actions.md) or on [controls](Controls.md).
20+
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.
1521

1622
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.
1723

@@ -29,4 +35,36 @@ Processors can have parameters which can be booleans, integers, or floating-poin
2935
// Example: First invert the value, then normalize [0..10] values to [0..1].
3036
3137
"invert,normalize(min=0,max=10)"
32-
```
38+
```
39+
40+
## When to use which Processor
41+
42+
Below you will find various example scenarios for different Processor types, note that there are more cases where the Processors apply and the described scenarios are just illustrating some of them. In some cases it might be useful to combine processors to achieve a certain goal.
43+
If you don't find a similar scenario for your use-case, please check out the [Processor Types](ProcessorTypes.md), this page also contains more information on how to write your own custom Processors.
44+
45+
### Invert
46+
47+
In order to use an axis control to mimic a ship's rudder, inverting the input will lead to the desired result. Pulling the stick left will steer the ship to the right, while pulling the stick to the right will lead to the ship moving left.
48+
This can be achieved using an [Invert Processor](ProcessorTypes.md#invert) on the Action or the Binding.
49+
50+
### Normalize
51+
52+
To let the player always move with the same speed, where the input just triggers the action and controls the direction, the [Normalize Processors](ProcessorTypes.md#normalize) is a good choice. This is accomplished by retrieving the vector of an input without considering the length of the vector, but rather evaluating the direction of the input.
53+
54+
### Scale
55+
56+
Scaling the input values for the yaw, pitch and roll of a plane, controlled with a stick can help to balance the level of control. In order to simplify the control, the roll of the plane can be mitigated compared to the pitch. In this case a [Scale Processor](ProcessorTypes.md#scale) is the right choice.
57+
58+
To allow a custom setup for the speed of the mouse in X and Y direction (eg via a game menu), a Scale Processor can be applied directly to the control itself. This way it will not affect other controls that are associated with the Bindings or Actions.
59+
60+
### Deadzone
61+
62+
To filter noise from controls that are hardly in a default state, keep sending input values, or rarely report the maximum value, a [Deadzone Processor](ProcessorTypes.md#axis-deadzone) might be the right choice.
63+
The minimum value can filter out minimal movements or noise of the control, while the maximum value can mitigate the difference between the controls maximum value and the reported maximum values.
64+
65+
The Deadzone Processor can be used to provide accessiblity to physically difficult input gestures, like very small movements on an input device. This can be used to be configurable through a game menu for instance.
66+
67+
### Clamp
68+
69+
In a case where the player is not supposed to completely stop and needs to keep a base speed, but also can not to go a speed higher than value X, a [Clamp Processor](ProcessorTypes.md#clamp) is the Processor you may want to use.
70+
The minimum value of the Processor will define the minimum input value that will be received, while the value can not go higher than the maximum value set.

0 commit comments

Comments
 (0)