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
The Input System stores your configuration of [Input Actions](Actions.md) and their associated [Bindings](ActionBindings.md), [Action Maps](ActionsEditor.html#configure-action-maps) and [Control Schemes](ActionBindings.md#control-schemes) in an [Action Asset](ActionAssets.md) file. These Assets have the `.inputactions` file extension and are stored in a plain JSON format.
5
+
6
+
The input system creates an Action Asset when you set up the [default project-wide actions](ProjectWideActions.md), but you can also create new Action Assets directly in the Project window.
7
+
8
+
For most common scenarios, you do not need to use more than one Input Action Asset. This is because an Action Asset can contain multiple [Action Maps](ActionsEditor.html#configure-action-maps), which each containing a set of actions relevant to the various parts of your project (such as UI navigation, gameplay, etc).
9
+
10
+
## Project-Wide Actions
11
+
12
+
You can assign an individual Action Asset to be available "project-wide", which means the actions within that asset are available more conveniently through the Input System API without needing to set up references to the asset.
13
+
14
+
When you [assign an Action Asset as project-wide](assign-project-wide-actions.md), it also becomes automatically [preloaded](https://docs.unity3d.com/ScriptReference/PlayerSettings.GetPreloadedAssets.html) when your app starts up, and is kept available until it terminates.
15
+
16
+
Unless you have specific project requirements that require more than one Action Asset, the recommended workflow is to use a single Action Asset assigned as the project-wide actions.
17
+
18
+
## Modifying Input Action Assets at runtime
19
+
There are several ways to modify an Input Action Asset at runtime. Any modifications that you make during Play mode to an Input Action Asset do not persist in the Input Action Asset after you exit Play mode. This means you can test your application in a realistic manner in the Editor without having to worry about inadvertently modifying the asset. For examples on how to modify an Input Action Asset, see the documentation on [Creating Actions in code](Actions.md#creating-actions-in-code) and [Changing Bindings](ActionBindings.md#changing-bindings).
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/action-assets.md
+12-58Lines changed: 12 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,63 +3,17 @@ uid: input-system-action-assets
3
3
---
4
4
# Input Action Assets
5
5
6
-
The Input System stores your configuration of [Input Actions](Actions.md) and their associated [Bindings](ActionBindings.md), [Action Maps](ActionsEditor.html#configure-action-maps) and [Control Schemes](ActionBindings.md#control-schemes) in an [Action Asset](ActionAssets.md) file.
7
-
8
-
While it's possible to have more than one Action Asset in a project, most projects only ever need a single Action Asset.
9
-
10
-
These Assets have the `.inputactions` file extension and are stored in a plain JSON format.
11
-
12
-
The input system creates an Action Asset when you set up the [default project-wide actions](ProjectWideActions.md), but you can also create new Action Assets directly in the Project window.
13
-
14
-
For most common scenarios, you do not need to use more than one Input Action Asset. This is because an Action Asset can contain multiple [Action Maps](ActionsEditor.html#configure-action-maps), which each containing a set of actions relevant to the various parts of your project (such as UI navigation, gameplay, etc).
15
-
16
-
## Descriptive heading
17
-
18
-
Use descriptive headings to break up the content and make the page easy to
19
-
scan. Organize content logically and introduce ideas gradually.
-[Using Action Assets with `PlayerInput`](#using-action-assets-with-playerinput)
40
-
-[Modifying Input Action Assets at runtime](#modifying-input-action-assets-at-runtime)
41
-
42
-
## Project-Wide Actions
43
-
44
-
The Input System's **project-wide actions** feature allows you to choose an individual Action Asset to be available project-wide, which means the actions within that asset are available more conveniently through the Input System API without needing to set up references to a specific asset.
45
-
46
-
When you assign an Action Asset as project-wide, it also becomes automatically [preloaded](https://docs.unity3d.com/ScriptReference/PlayerSettings.GetPreloadedAssets.html) when your app starts up, and is kept available until it terminates.
47
-
48
-
Unless you have specific project requirements that require more than one Action Asset, the recommended workflow is to use a single Action Asset assigned as the project-wide actions.
49
-
50
-
51
-
52
-
53
-
## Using Input Action Assets
54
-
55
-
56
-
### Using Action Assets with `PlayerInput`
57
-
58
-
The [Player Input](player-input-component.md) component provides a convenient way to handle input for one or multiple players. You can assign your Action Asset to the Player Input component so that it can then automatically handle activating Action Maps and selecting Control Schemes for you.
59
-
60
-

61
-
62
-
### Modifying Input Action Assets at runtime
63
-
There are several ways to modify an Input Action Asset at runtime. Any modifications that you make during Play mode to an Input Action Asset do not persist in the Input Action Asset after you exit Play mode. This means you can test your application in a realistic manner in the Editor without having to worry about inadvertently modifying the asset. For examples on how to modify an Input Action Asset, see the documentation on [Creating Actions in code](Actions.md#creating-actions-in-code) and [Changing Bindings](ActionBindings.md#changing-bindings).
6
+
The Input System stores your configuration of [Input Actions](Actions.md) and their associated [Bindings](ActionBindings.md), [Action Maps](ActionsEditor.html#configure-action-maps) and [Control Schemes](ActionBindings.md#control-schemes) in an **Action Asset**.
7
+
8
+
Learn how to create, assign and use them in this section.
|**[About action assets](./about-action-assets.md)**| More information to help you understand what action assets are for. |
13
+
|**[Create and assign a project-wide action asset](create-project-wide-actions.md)**| Create an actions asset that contains the built-in default actions, and assign them as project-wide. |
14
+
|**[Create an empty action asset](create-empty-action-asset.md)**| Create a new empty action asset. |
15
+
|**[Assign a project-wide action asset](assign-project-wide-asset.md)**| Change which action asset is assigned as project-wide. |
16
+
|**[Default actions](default-actions.md)**| When you create and assign default project-wide actions, the Action Asset comes pre-configured with some default Actions which suit many common app and game scenarios. Learn about them here. |
17
+
|**[Generate C# API from actions](./link)**| Input Action Assets allow you to generate a C# class from your action definitions, which allow you to refer to your actions in a type-safe manner from code. This means you can avoid looking up your actions by string. |
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/assign-project-wide-actions.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,16 @@
2
2
3
3
To assign an existing Actions Asset as project-wide, do one of the following:
4
4
5
-
- Go to **Edit** > **Project Settings** > **Input System Package**, then drag the asset from your Project window into the **Project-wide Actions** field.
5
+
1. Go to **Edit** > **Project Settings** > **Input System Package**
6
+
2. Drag the asset from your Project window into the **Project-wide Actions** field.
7
+
6
8
</br>
7
9
*The Input System Package Project Settings with no project-wide actions assigned*
8
10
9
11
or:
10
12
11
-
- Select the Asset in your Project window, then in the Inspector window, select **Assign as the Project-wide Input Actions**.
13
+
1. Select the Asset in your Project window
14
+
2. In the Inspector window, select **Assign as the Project-wide Input Actions**.
12
15
13
16
14
17
Only one Actions Asset can be assigned as project-wide. If a different asset was previously assigned as project-wide, it becomes unassigned.
Usually you only need one Action Asset, assigned as the project-wide actions. The input package provides a convenient way to [create a set of useful default actions and assign them as project-wide](assign-project-wide-actions.md). In other cases, you might want to start with an empty actions asset, or create more than one actions asset.
4
+
5
+
To do this:
6
+
7
+
1. Go to __Assets > Create > Input Actions__ from Unity's main menu/
8
+
9
+
(or)
10
+
11
+
1. Click the project window's **Add (+)** button.
12
+
2. Select **Input Actions** from the menu.
13
+
14
+
When you create an action asset this way, the new action asset is empty, containing no actions, action maps, or control schemes. You must [add](./create-actions.md) and [configure](./configure-actions.md) new actions to use it. The new action asset is also not assigned as [project-wide](./assign-project-wide-actions.md).
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/create-project-wide-actions.md
+2-15Lines changed: 2 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,4 @@
1
-
# Create an action asset
2
-
3
-
In most cases, you only need one Action Asset, assigned as the project-wide actions. The input package provides a convenient way to create a set of useful default actions and assign them as project-wide. In other cases, you might want to start with an empty actions asset, or create more than one actions asset.
4
-
5
-
## Create and assign a default project-wide actions asset
1
+
# Create and assign a default project-wide actions asset
6
2
7
3
Follow these steps to create an actions asset that contains the built-in [default actions](./TheDefaultActions.md), and assign them as project-wide.
8
4
@@ -29,13 +25,4 @@ When you create an action asset this way, the new asset contains a set of defaul
29
25

30
26
*The Input System Package Project Settings after creating and assigning the default actions*
31
27
32
-
Once you have created and assigned project-wide actions, the Input System Package page in Project Settings displays the **Actions Editor** interface. Read more about how to use the [Actions Editor](ActionsEditor.md) to configure your actions.
33
-
34
-
## Create a new empty input action asset
35
-
36
-
In some situations you might want to start with an empty action asset, or create additional action assets.
37
-
38
-
To do this, go to __Assets > Create > Input Actions__ from Unity's main menu, or select **Input Actions** the Project window's **Add (+)** button menu.
39
-
40
-
When you create an action asset this way, the new action asset is empty, containing no actions, action maps, or control schemes. You must [add](./CreateActions.md) and [configure](./ConfigureActions.md) new actions to use it. The new action asset is also not assigned as [project-wide](./ProjectWideActions.md).
41
-
28
+
Once you have created and assigned project-wide actions, the Input System Package page in Project Settings displays the **Actions Editor** interface. Read more about how to use the [Actions Editor](ActionsEditor.md) to configure your actions.
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/default-actions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# The default project-wide actions
2
2
3
-
When you [create and assign default project-wide actions](CreateActionAsset.md) the Action Asset comes pre-configured with some default Actions such as "Move", "Jump", and more, which suit many common app and game scenarios. They are configured to read input from the most common types of input controller such as Keyboard, Mouse, Gamepad, Touchscreen, and extended reality (XR).
3
+
When you [create and assign default project-wide actions](./create-project-wide-actions.md) the Action Asset comes pre-configured with some default Actions such as "Move", "Jump", and more, which suit many common app and game scenarios. They are configured to read input from the most common types of input controller such as Keyboard, Mouse, Gamepad, Touchscreen, and extended reality (XR).
4
4
5
5

6
6
*The Input System Package Project Settings after creating and assigning the default actions*
0 commit comments