Composite types reference
Find the parts and parameters of each composite type that the Input System provides.
Each composite type has a fixed set of parts, and some types have parameters that change how they compute their value. You set parameters in the Binding Properties panel, or in code. Button controls, such as keys, also work as parts, because they provide an axis value.
For an introduction to composite bindings and the names of each type, refer to Composite bindings. To use these names in a script, refer to Add composite bindings in code.
1D axis
A 1D axis composite is made of two buttons: one pulls a 1D axis in its negative direction, and the other pulls it in its positive direction. The AxisComposite class computes the float value.
The 1D axis composite has the following parts.
| Part | Name in code | Control type | Description |
|---|---|---|---|
| Negative | negative |
Axis | Pulls the axis in the negative direction, towards minValue. |
| Positive | positive |
Axis | Pulls the axis in the positive direction, towards maxValue. |
It has the following property.
| Property | Name in code | Description |
|---|---|---|
| Which Side Wins | whichSideWins |
What happens if the user actuates Negative and Positive at the same time. The default is Neither. |
The Which Side Wins property has the following values.
| Value | Value in code | Description |
|---|---|---|
| Neither | 0 |
Neither side wins, and the composite returns the midpoint between minValue and maxValue, which is 0 by default. |
| Positive | 1 |
The positive side wins, and the composite returns maxValue. |
| Negative | 2 |
The negative side wins, and the composite returns minValue. |
In code, you can also set minValue, the value the composite returns for Negative (default -1), and maxValue, the value it returns for Positive (default 1). The Binding Properties panel doesn't show these parameters. The composite doesn't smooth its value over time. When the input on a part changes, the composite's value changes in the same update.
2D vector
A 2D vector composite represents a four-way button control, like the D-pad on a gamepad, where each button represents a cardinal direction. Use it for up-down-left-right input such as the W, A, S, and D keys. The Vector2Composite class computes the Vector2 value.
The 2D vector composite has the following parts.
| Part | Name in code | Control type | Description |
|---|---|---|---|
| Up | up |
Axis | Represents (0,1) (+Y). |
| Down | down |
Axis | Represents (0,-1) (-Y). |
| Left | left |
Axis | Represents (-1,0) (-X). |
| Right | right |
Axis | Represents (1,0) (+X). |
It has the following property.
| Property | Name in code | Description |
|---|---|---|
| Mode | mode |
Whether to treat the inputs as digital or analog controls. The default is Digital Normalized. |
The Mode property has the following values.
| Value | Value in code | Description |
|---|---|---|
| Digital Normalized | 0 |
Treats each input as a button, which is 1 at or above the default button press point and 0 below it, then normalizes the resulting vector. The input range is diamond-shaped. |
| Digital | 1 |
The same as Digital Normalized, but the Input System doesn't normalize the vector. |
| Analog | 2 |
Passes the input values through as floating-point values, and inverts Down and Left. |
The composite doesn't smooth its value over time. When the input on a part changes, the composite's value changes in the same update.
3D vector
A 3D vector composite represents a six-way button control, where each pair of opposite buttons controls one axis of a 3D vector. The Vector3Composite class computes the Vector3 value.
The 3D vector composite has the following parts.
| Part | Name in code | Control type | Description |
|---|---|---|---|
| Up | up |
Axis | Represents (0,1,0) (+Y). |
| Down | down |
Axis | Represents (0,-1,0) (-Y). |
| Left | left |
Axis | Represents (-1,0,0) (-X). |
| Right | right |
Axis | Represents (1,0,0) (+X). |
| Forward | forward |
Axis | Represents (0,0,1) (+Z). |
| Backward | backward |
Axis | Represents (0,0,-1) (-Z). |
It has the following property.
| Property | Name in code | Description |
|---|---|---|
| Mode | mode |
Whether to treat the inputs as digital or analog controls. The default is Analog. |
The Mode property has the following values. They work like the 2D vector modes, but have different values in code.
| Value | Value in code | Description |
|---|---|---|
| Analog | 0 |
Passes the input values through as floating-point values, and inverts Down, Left, and Backward. |
| Digital Normalized | 1 |
Treats each input as a button, which is 1 at or above the default button press point and 0 below it, then normalizes the resulting vector. |
| Digital | 2 |
The same as Digital Normalized, but the Input System doesn't normalize the vector. |
One modifier
A one modifier composite produces a value only while the user holds down a modifier button. For example, use it for a binding such as Ctrl+1. The OneModifierComposite class computes the value, which has the same type as the control bound to Binding. The buttons can be on any device, and can be toggle buttons or full-range buttons such as gamepad triggers.
The one modifier composite has the following parts.
| Part | Name in code | Control type | Description |
|---|---|---|---|
| Modifier | modifier |
Button | The button the user must hold before the composite outputs the value of Binding. While the user doesn't press any button bound to Modifier, the composite stays at its default value. |
| Binding | binding |
Any | The controls whose value the composite takes while the user holds Modifier. |
It has the following property.
| Property | Name in code | Description |
|---|---|---|
| Modifiers Order | modifiersOrder |
Whether the user must press Modifier before Binding. The default is Default. |
The Modifiers Order property has the following values.
| Value | Value in code | Description |
|---|---|---|
| Default | 0 |
When Binding is bound only to buttons, the user must press Modifier first, unless shortcutKeysConsumeInput is disabled or shortcutKeysUseActionPriority is enabled. |
| Ordered | 1 |
When Binding is bound only to buttons, the user must press Modifier first. |
| Unordered | 2 |
The user can press the buttons in any order, as long as all of them are pressed at the same time. |
The Binding Properties panel also shows Override Modifiers Need To Be Pressed First, which is obsolete. Use Modifiers Order instead.
Two modifiers
A two modifiers composite produces a value only while the user holds down two modifier buttons. For example, use it for a binding such as Ctrl+Shift+1. The TwoModifiersComposite class computes the value, which has the same type as the control bound to Binding. The buttons can be on any device, and can be toggle buttons or full-range buttons such as gamepad triggers.
The two modifiers composite has the following parts.
| Part | Name in code | Control type | Description |
|---|---|---|---|
| Modifier 1 | modifier1 |
Button | The first button the user must hold, together with Modifier 2, before the composite outputs the value of Binding. While the user doesn't press any button bound to Modifier 1, the composite stays at its default value. |
| Modifier 2 | modifier2 |
Button | The second button the user must hold, together with Modifier 1, before the composite outputs the value of Binding. While the user doesn't press any button bound to Modifier 2, the composite stays at its default value. |
| Binding | binding |
Any | The controls whose value the composite takes while the user holds both Modifier 1 and Modifier 2. |
It has the following property.
| Property | Name in code | Description |
|---|---|---|
| Modifiers Order | modifiersOrder |
Whether the user must press both modifiers before Binding. The values are the same as for the one modifier composite. |
The Binding Properties panel also shows Override Modifiers Need To Be Pressed First, which is obsolete. Use Modifiers Order instead.