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~/ActionAssets.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,11 @@ An Input Action Asset is an Asset containing [Input Actions](Actions.md) as well
8
8
9
9
## Creating Input Action Assets
10
10
11
-
To create an Asset containing [Input Acions](Actions.md) in Unity, right-click in the __Project__ window or go to __Assets > Create > Input Actions__in Unity's main menu.
11
+
To create an Asset containing [Input Actions](Actions.md) in Unity, right-click in the __Project__ window or go to __Assets > Create > Input Actions__from Unity's main menu.
12
12
13
13
## Editing Input Action Assets
14
14
15
-
To bring up the Action editor, double-click an `.inputactions`asset in the Project Browser or click the __Edit Asset__ button in the inspector for that Asset. You can have more than one editor window open at the same time, but not for the same Asset.
15
+
To bring up the Action editor, double-click an `.inputactions`Asset in the Project Browser, or click the __Edit Asset__ button in the inspector for that Asset. You can have more than one editor window open at the same time, but not for the same Asset.
16
16
17
17

18
18
@@ -24,7 +24,7 @@ By default, Unity doesn't save edits you make in the Action Asset window when yo
24
24
25
25
>__Note__: This setting affects all `.inputactions` Assets, and persists across Unity Editor sessions.
26
26
27
-
The editor window is divided into three panes.
27
+
The editor window is divided into three panes:
28
28
29
29
1. The left pane lists the Action Maps in the Asset. Each Map is a collection of Actions that you can enable or disable in bulk.
30
30
2. The middle pane contains the Actions in the currently selected Action Map, and the bindings associated with each Action.
@@ -34,16 +34,16 @@ Use the following keyboard shortcuts to quickly trigger common operations:
34
34
35
35
|Shortcut (Mac)|Shortcut (Windows)|Description|
36
36
|--------------|------------------|-----------|
37
-
|⌘X, ⌘C, ⌘V|Ctrl-X, Ctrl-C, Ctrl-V|Cut, Copy and Paste. Can be used on Actions, Action Maps and Bindings.|
38
-
|⌘D|Ctrl-D|Duplicate. Can be used on Actions, Action Maps and Bindings.|
39
-
|⌘⌫|Del|Delete. Can be used on Actions, Action Maps and Bindings.|
37
+
|⌘X, ⌘C, ⌘V|Ctrl-X, Ctrl-C, Ctrl-V|Cut, Copy, and Paste. Can be used on Actions, Action Maps, and Bindings.|
38
+
|⌘D|Ctrl-D|Duplicate. Can be used on Actions, Action Maps, and Bindings.|
39
+
|⌘⌫|Del|Delete. Can be used on Actions, Action Maps, and Bindings.|
40
40
|⌥S|Alt-S|Save.|
41
41
|⌥M|Alt-M|Add Action Map.|
42
42
|⌥A|Alt-A|Add Action.|
43
43
|⌥B|Alt-B|Add Binding.|
44
44
45
45
46
-
>__Tip__: You can search for Devices and/or Control Schemes directly from the search box. For example, "d:gamepad" filters for bindings to gamepad Devices, whereas "g:gamepad" filters for bindings in the "gamepad" Control Scheme. Matching is case-insensitive and will match any partial name.
46
+
>__Tip__: You can search for Devices and/or Control Schemes directly from the search box. For example, "d:gamepad" filters for bindings to gamepad Devices, whereas "g:gamepad" filters for bindings in the "gamepad" Control Scheme. Matching is case-insensitive and matches any partial name.
47
47
48
48
### Editing Action Maps
49
49
@@ -52,7 +52,7 @@ Use the following keyboard shortcuts to quickly trigger common operations:
* To add a new Action Map, click the plus icon in the header of the Action Map column.
55
-
* To rename an existing Action Map, either long-click the name, or right-click the action map and select __Rename__ from the context menu.
55
+
* To rename an existing Action Map, either long-click the name, or right-click the Action Map and select __Rename__ from the context menu.
56
56
* To delete an existing Action Map, either right-click it and select __Delete__ from the context menu, or use the Delete key (Windows) / ⌘⌫ (Mac).
57
57
* To duplicate an existing Action Map, either right-click it and select __Duplicate__ from the context menu, or use Ctrl-D (Windows) / ⌘D (Mac).
58
58
@@ -81,7 +81,7 @@ If you select a Binding, you can edit its properties in the right-hand pane of t
81
81
82
82
#### Picking Controls
83
83
84
-
The most important property of any Binding is the [control path](Controls.md#control-paths) it's bound to. To edit it, open the __Path__ drop-down list. This will pop up a Control picker window.
84
+
The most important property of any Binding is the [control path](Controls.md#control-paths) it's bound to. To edit it, open the __Path__ drop-down list. This pops up a Control picker window.
85
85
86
86

87
87
@@ -131,8 +131,8 @@ using UnityEngine.InputSystem;
// MyPlayerControls is the C# class that has been generated for us.
135
-
// It encapsulates the data from the .inputactions asset we created
134
+
// MyPlayerControls is the C# class that Unity generated.
135
+
// It encapsulates the data from the .inputactions asset we created
136
136
// and automatically looks up all the maps and actions for us.
137
137
MyPlayerControlscontrols;
138
138
@@ -168,6 +168,6 @@ public class MyPlayerScript : MonoBehaviour, IGameplayActions
168
168
169
169
### Using Action Assets with `PlayerInput`
170
170
171
-
The [`PlayerInput`](Components.md#playerinput-component) component provides a convenient way to handle input for one or multiple players. It requires you to set up all your Actions in an Input Action Asset, which you can then assign to the [`PlayerInput`](Components.md#playerinput-component) component. [`PlayerInput`](Components.md#playerinput-component) can then automatically handle activating Action Maps and selecting Control Schemes for you. Check the documentation on [GameObject Components for Input](Components.md) to learn more.
171
+
The [`PlayerInput`](Components.md#playerinput-component) component provides a convenient way to handle input for one or multiple players. It requires you to set up all your Actions in an Input Action Asset, which you can then assign to the [`PlayerInput`](Components.md#playerinput-component) component. [`PlayerInput`](Components.md#playerinput-component) can then automatically handle activating Action Maps and selecting Control Schemes for you. To learn more, see the documentation on [GameObject Components for Input](Components.md).
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/ActionBindings.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
1
# Input Bindings
2
2
3
-
An [`InputBinding`](../api/UnityEngine.InputSystem.InputBinding.html) represents a connection between an [Action](Actions.md) and one or more [Controls](Controls.md) identified by a [Control path](Controls.md#control-paths). An Action have an arbitrary number of Bindings pointed at it. Multiple Bindings can reference the same Control.
3
+
An [`InputBinding`](../api/UnityEngine.InputSystem.InputBinding.html) represents a connection between an [Action](Actions.md) and one or more [Controls](Controls.md) identified by a [Control path](Controls.md#control-paths). An Action can have an arbitrary number of Bindings pointed at it. Multiple Bindings can reference the same Control.
4
4
5
5
Each Binding has the following properties:
6
6
7
7
|Property|Description|
8
8
|--------|-----------|
9
9
|[`path`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_path)|[Control path](Controls.md#control-paths) that identifies the control(s) from which the Action should receive input.<br><br>Example: `"<Gamepad>/leftStick"`|
10
-
|[`overridePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overridePath)|[Control path](Controls.md#control-paths) that overrides `path`. Unlike `path`, `overridePath` is not persistent, meaning that it can be used to non-destructively override the path on a Binding. If it is set to something other than null, it will take effect and override `path`. If you want to get the path which is currently being used (that is either `path` or `overridePath`), you can query the [`effectivePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_effectivePath) property.|
10
+
|[`overridePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overridePath)|[Control path](Controls.md#control-paths) that overrides `path`. Unlike `path`, `overridePath` is not persistent, so you can use it to non-destructively override the path on a Binding. If it's set to something other than null, it will take effect and override `path`. If you want to get the path which is currently being used (that is either `path` or `overridePath`), you can query the [`effectivePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_effectivePath) property.|
11
11
|[`action`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_action)|The name or ID of the Action that the Binding should trigger. Note that this can be null or empty (for instance, for [composites](#composite-bindings)). Case-insensitive.<br><br>Example: `"fire"`|
12
12
|[`groups`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_groups)|A semicolon-separated list of Binding groups that the Binding belongs to. Can be null or empty. Binding groups can be anything, but are mostly used for [Control Schemes](#control-schemes). Case-insensitive.<br><br>Example: `"Keyboard&Mouse;Gamepad"`|
13
13
|[`interactions`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_interactions)|A semicolon-separated list of [Interactions](Interactions.md) to apply to input on this Binding. Note that Unity appends Interactions applied to the [Action](Actions.md) itself (if any) to this list. Case-insensitive.<br><br>Example: `"slowTap;hold(duration=0.75)"`|
14
-
|[`processors`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_processors)|A semicolon-separated list of [Processors](Processors.md) to apply to input on this Binding. Note that Unity appends Processors applied to the [Action](Actions.md) itself (if any) to this list. Case-insensitive.<br><br>Processors applied to Bindings apply in addition to Processors applied to Controls that are providing values. If, for example, you put a `stickDeadzone` Processor on a Binding and then bind it to `<Gamepad>/leftStick`, you will get deadzones applied twice: once from the deadzone Processor sitting on the `leftStick` Control and once from the Binding.<br><br>Example: `"invert;axisDeadzone(min=0.1,max=0.95)"`|
14
+
|[`processors`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_processors)|A semicolon-separated list of [Processors](Processors.md) to apply to input on this Binding. Note that Unity appends Processors applied to the [Action](Actions.md) itself (if any) to this list. Case-insensitive.<br><br>Processors applied to Bindings apply in addition to Processors applied to Controls that are providing values. If, for example, you put a `stickDeadzone` Processor on a Binding and then bind it to `<Gamepad>/leftStick`, you will get deadzones applied twice: once from the deadzone Processor sitting on the `leftStick` Control, and once from the Binding.<br><br>Example: `"invert;axisDeadzone(min=0.1,max=0.95)"`|
15
15
|[`id`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_id)|Unique ID of the Binding. You can use it to identify the Binding when storing Binding overrides in user settings, for example.|
16
16
|[`name`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_name)|Optional name of the Binding. Most importantly used to identify part names inside [Composites](#composite-bindings).<br><br>Example: `"Positive"`|
17
17
|[`isComposite`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_isComposite)|Whether the Binding acts as a [Composite](#composite-bindings).|
18
18
|[`isPartOfComposite`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_isPartOfComposite)|Whether the Binding is part of a [Composite](#composite-bindings).|
19
19
20
-
You can query the Bindings to a particular Action using [`InputAction.bindings`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_bindings). You can also query a flat list of Nindings for all Actions in an Action Map using [`InputActionMap.bindings`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_bindings).
20
+
You can query the Bindings to a particular Action using [`InputAction.bindings`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_bindings). You can also query a flat list of Bindings for all Actions in an Action Map using [`InputActionMap.bindings`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_bindings).
21
21
22
22
## Composite Bindings
23
23
@@ -107,11 +107,11 @@ In addition, you can set the following parameters on a 2D vector Composite:
107
107
108
108
|Parameter|Description|
109
109
|---------|-----------|
110
-
|[`normalize`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_normalize)|Whether the resulting vector should be normalized or not. If this is disabled, then, for example, pressing both [`up`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_up) and [`right`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_right)will yield a vector `(1,1)` which has a length greater than 1. This can be undesirable in situations where the vector's magnitude matters (for example, when scaling running speed by the length of the input vector).<br><br>This is true by default.|
110
+
|[`normalize`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_normalize)|Whether the resulting vector should be normalized or not. If this is disabled, then, for example, pressing both [`up`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_up) and [`right`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_right) yields a vector `(1,1)` which has a length greater than 1. This can be undesirable in situations where the vector's magnitude matters (for example, when scaling running speed by the length of the input vector).<br><br>This is true by default.|
111
111
112
112
### Button with one modifier
113
113
114
-
A Composite that requires another button to be held when pressing the button that triggers the Action. Implemented in the [`ButtonWithOneModifier`](../api/UnityEngine.InputSystem.Composites.ButtonWithOneModifier.html) class. This is useful, for example, to represent keyboard shortcuts such as Ctrl+1 but isn't restricted to keyboard controls. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.
114
+
A Composite that requires another button to be held when pressing the button that triggers the Action. Implemented in the [`ButtonWithOneModifier`](../api/UnityEngine.InputSystem.Composites.ButtonWithOneModifier.html) class. This is useful, for example, to represent keyboard shortcuts such as Ctrl+1, but isn't restricted to keyboard controls. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.
115
115
116
116
The result is a `float`.
117
117
@@ -133,7 +133,7 @@ This Composite has no parameters.
133
133
134
134
### Button with two modifiers
135
135
136
-
A Composite that requires two other buttons to be held when pressing the button that triggers the Action. Implemented in the [`ButtonWithTwoModifiers`](../api/UnityEngine.InputSystem.Composites.ButtonWithTwoModifiers.html) class. This is useful, for example, to represent keyboard shortcuts such as "Ctrl+Shift+1" but isn't restricted to keyboard controls. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.
136
+
A Composite that requires two other buttons to be held when pressing the button that triggers the Action. Implemented in the [`ButtonWithTwoModifiers`](../api/UnityEngine.InputSystem.Composites.ButtonWithTwoModifiers.html) class. This is useful, for example, to represent keyboard shortcuts such as Ctrl+Shift+1, but isn't restricted to keyboard controls. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.
137
137
138
138
The result is a `float`.
139
139
@@ -173,7 +173,7 @@ To define a new type of Composite, create a class based on [`InputBindingComposi
// Each part binding is represented as a field of type int and annotated with
176
-
// InputControlAttribute. Setting "layout" allows to restrict the controls that
176
+
// InputControlAttribute. Setting "layout" restricts the controls that
177
177
// are made available for picking in the UI.
178
178
//
179
179
// On creation, the int value will be set to an integer identifier for the binding
@@ -285,7 +285,7 @@ If multiple Controls are bound to an Action, the Input System monitors input fro
285
285
286
286
Unity decides which Control is currently driving the Action in a process called disambiguation. During the disambiguation process, the Input System looks at the value of each Control bound to an Action. If the [magnitude](Controls.md#control-actuation) of the input from any Control is higher then the magnitude of the Control currently driving the Action, then the Control with the higher magnitude becomes the new Control driving the Action. In the above example of `<Gamepad>/leftStick` binding to multiple gamepads, the Control driving the Action is the left stick which is actuated the furthest of all the gamepads. You can query which Control is currently driving the Action by checking the [`InputAction.CallbackContext.control`](../api/UnityEngine.InputSystem.InputAction.CallbackContext.html#UnityEngine_InputSystem_InputAction_CallbackContext_control) property in an [Action callback](Actions.md#started-performed-and-canceled-callbacks).
287
287
288
-
If you don't want your Action to perform disambiguation, you can set your Action type to [Pass-Through](Actions.md#pass-through). Pass-Through Actions skip disambiguation, changes to any bound Control trigger them. The value of a Pass-Through Action is the value of whichever bound Control changed most recently.
288
+
If you don't want your Action to perform disambiguation, you can set your Action type to [Pass-Through](Actions.md#pass-through). Pass-Through Actions skip disambiguation, and changes to any bound Control trigger them. The value of a Pass-Through Action is the value of whichever bound Control changed most recently.
0 commit comments