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~/HowDoI.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
@@ -14,13 +14,13 @@ A collection of frequently asked questions, and where to find their answers in t
14
14
15
15
How do I...?
16
16
17
-
-[check if a specific key or button was pressed this frame?](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_wasPressedThisFrame)
17
+
-[check if a specific key or button was pressed this frame?](xref:UnityEngine.InputSystem.Controls.ButtonControl)
18
18
19
-
-[check if any key or button was pressed](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onAnyButtonPress)
19
+
-[check if any key or button was pressed](xref:UnityEngine.InputSystem.InputSystem)
20
20
21
-
-[find all connected gamepads?](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_all)
21
+
-[find all connected gamepads?](xref:UnityEngine.InputSystem.Gamepad)
22
22
23
-
-[find the gamepad that the player is currently using?](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_current)
23
+
-[find the gamepad that the player is currently using?](xref:UnityEngine.InputSystem.Gamepad)
24
24
25
25
-[know when a new device was plugged in?](monitor-devices.md)
26
26
@@ -33,21 +33,21 @@ Use the same techniques shown for the "Jump" action in the [Workflows section](w
33
33
34
34
-[use a "positive" and a "negative" button to drive an axis?](configure-bindings-from-code.md#1d-axis)
35
35
36
-
-[create a UI to rebind input in my game?](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html)
36
+
-[create a UI to rebind input in my game?](xref:UnityEngine.InputSystem.InputActionRebindingExtensions)
37
37
38
-
-[set up an Action to specifically target the left-hand XR controller?](../api/UnityEngine.InputSystem.XR.XRController.html#UnityEngine_InputSystem_XR_XRController_leftHand)
38
+
-[set up an Action to specifically target the left-hand XR controller?](xref:UnityEngine.InputSystem.XR.XRController)
39
39
40
-
-[make my left-hand XR controller my right-hand one?](../api/UnityEngine.InputSystem.XR.XRController.html#UnityEngine_InputSystem_XR_XRController_leftHand)
40
+
-[make my left-hand XR controller my right-hand one?](xref:UnityEngine.InputSystem.XR.XRController)
41
41
42
42
-[get all current touches from the touchscreen?](devices-touch.md#reading-all-touches)
43
43
44
-
-[deal with my gamepad data arriving in a format different from `GamepadState`?](../api/UnityEngine.InputSystem.LowLevel.GamepadState.html)
44
+
-[deal with my gamepad data arriving in a format different from `GamepadState`?](xref:UnityEngine.InputSystem.LowLevel.GamepadState)
45
45
46
46
-[force the Input System to use my own layout when the native backend discovers a specific Device?](native-devices.md)
47
47
48
48
-[add deadzoning to my gamepad sticks?](query-gamepads.md#add-a-deadzone-to-a-gamepad)
49
49
50
-
-[give my head tracking an extra update before rendering?](../api/UnityEngine.InputSystem.XR.XRHMD.html)
50
+
-[give my head tracking an extra update before rendering?](xref:UnityEngine.InputSystem.XR.XRHMD)
51
51
52
52
-[record events flowing through the system?](debugging.md#other-tips)
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/Installation.md
+22-13Lines changed: 22 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,22 +3,30 @@ uid: input-system-installation
3
3
---
4
4
# Installation guide
5
5
6
-
-[Installation guide](#installation-guide)
7
-
-[Installing the package](#installing-the-package)
8
-
-[Enabling the new input backends](#enabling-the-new-input-backends)
9
-
-[Installing samples](#installing-samples)
6
+
This page describes how to install and activate the Input System package for your Unity Project.
10
7
11
-
This guide describes how to install and activate the Input System package for your Unity Project.
8
+
> [!NOTE]
9
+
> This version of the new Input System requires the .NET 4 runtime. It doesn't work in projects using the old .NET 3.5 runtime.
10
+
>
11
+
> This package is only compatible with Unity Editor release versions 2021.3 and later. If you are working in a release version of the Editor prior to 2021.3, you need to use the package version that works with that version of the Editor, indicated by the **Release** tag in the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui.html) window.
12
12
13
-
>__Note__: The new Input System requires Unity 2019.4+ and the .NET 4 runtime. It doesn't work in projects using the old .NET 3.5 runtime.
13
+
## Install the package
14
14
15
-
## Installing the package
15
+
To install the new Input System:
16
16
17
-
To install the new Input System, open Unity's package manager (menu: __Window > Package Manager__). Select the __Input System__ package from the list, then click __Install__.
17
+
1. In the main menu of the Unity Editor, go to __Window__ > __Package Manager__ to open the Unity Package Manager.
18
18
19
-

19
+
2. Select **Unity Registry** from the navigation panel.
20
20
21
-
## Enabling the new input backends
21
+
3. Select the __Input System__ package from the list.
22
+
23
+
The Package Manager automatically selects that version to install by default.
24
+
25
+
4. Select __Install__, follow any prompts to [enable the backends](#) for the new Input System.
26
+
27
+
This package also provides several samples that demonstrate how to work with the new Input System, which are also available on the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui.html) window. Refer to [Install samples](#install-samples).
28
+
29
+
## Enable the new input backends
22
30
23
31
By default, Unity's classic Input Manager (`UnityEngine.Input`) is active, and support for the new Input System is inactive. This allows existing Unity Projects to keep working as they are.
24
32
@@ -28,16 +36,17 @@ When you install the Input System package, Unity will ask whether you want to en
28
36
29
37
You can find the corresponding setting in __Edit__ > __Project Settings__ > __Player__ > __Other Settings__ > __Active Input Handling__. If you change this setting you must restart the Editor for it to take effect.
30
38
31
-
>**Note:** You can enable __both__ the old __and__ the new system at the same time. To do so, set **Active Input Handling** to **Both**.
39
+
> [!NOTE]
40
+
> You can enable __both__ the old __and__ the new system at the same time. To do so, set **Active Input Handling** to **Both**.
When the new input backends are enabled, the `ENABLE_INPUT_SYSTEM=1` C# `#define` is added to builds. Similarly, when the old input backends are enabled, the `ENABLE_LEGACY_INPUT_MANAGER=1` C# `#define` is added. Because both can be enabled at the same time, it is possible for __both__ defines to be 1 at the same time.
36
45
37
-
## Installing samples
46
+
## Install samples
38
47
39
48
The Input System package comes with a number of samples. You can install these directly from the Package Manager window in Unity (__Window > Package Manager__). To see the list of samples, select the Input System package in the Package Manager window and click the __Samples__ tab. Then click __Import__ next to any sample name to import it into the current Project.
40
49
41
50

42
51
43
-
For a more comprehensive demo project for the Input System, see the [InputSystem_Warriors](https://github.com/UnityTechnologies/InputSystem_Warriors) GitHub repository.
52
+
For a more comprehensive demo project for the Input System, see the [InputSystem_Warriors](https://github.com/UnityTechnologies/InputSystem_Warriors) GitHub repository.
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/TrackedInputDevices.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,12 @@ Use the Tracked Pose Driver component to synchronize a __GameObject__'s transfor
11
11
12
12
|**Property**|**Description**|
13
13
|-------------|-----------|
14
-
|[`Tracking Type`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_trackingType)|Specify which transform properties (position, rotation, or both) to update based on the tracked data.|
15
-
|[`Update Type`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_updateType)|Determine when updates to the transform occur within Unity's event loop, such as during rendering or gameplay.|
16
-
|[`Ignore Tracking State`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_ignoreTrackingState)| Enable to ignore the tracking state and assume that the input pose is valid, even when flagged otherwise.|
17
-
|[`Position Input`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_positionInput)|Set an input action that retrieves the position data (Vector3) of the tracked device.|
18
-
|[`Rotation Input`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_rotationInput)| Set an input action that retrieves the rotation data (Quaternion) of the tracked device.|
19
-
|[`Tracking State Input`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_trackingStateInput)|Set an input action that determines whether the tracking state (position or rotation) is valid (integer).|
14
+
|[`Tracking Type`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver)|Specify which transform properties (position, rotation, or both) to update based on the tracked data.|
15
+
|[`Update Type`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver)|Determine when updates to the transform occur within Unity's event loop, such as during rendering or gameplay.|
16
+
|[`Ignore Tracking State`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver)| Enable to ignore the tracking state and assume that the input pose is valid, even when flagged otherwise.|
17
+
|[`Position Input`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver)|Set an input action that retrieves the position data (Vector3) of the tracked device.|
18
+
|[`Rotation Input`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver)| Set an input action that retrieves the rotation data (Quaternion) of the tracked device.|
19
+
|[`Tracking State Input`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver)|Set an input action that determines whether the tracking state (position or rotation) is valid (integer).|
20
20
21
21
## Tracked Device Raycaster
22
22
@@ -28,8 +28,8 @@ The component also supports occlusion checks, custom ray distance limits, and fi
28
28
29
29
|**Property**|**Description**|
30
30
|-------------|-----------|
31
-
|[`Ignore Reversed Graphics`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_ignoreReversedGraphics)| Enable to ignore graphics whose normal faces away from the direction of the ray.|
32
-
|[`Check For 2D Occlusion`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_checkFor2DOcclusion)|Enable occlusion checks for 2D objects, such as sprites in the scene.|
33
-
|[`Check For 3D Occulusion`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_checkFor3DOcclusion)|Enable occlusion checks for 3D objects to prevent rays from passing through physical geometry.|
34
-
|[`Max Distance`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_maxDistance)|Set the maximum ray distance for interaction detection in world space coordinates.|
35
-
|[`Blocking Mask`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_blockingMask)|Define the layer mask used to check for occlusion when ray casting.|
31
+
|[`Ignore Reversed Graphics`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster)| Enable to ignore graphics whose normal faces away from the direction of the ray.|
32
+
|[`Check For 2D Occlusion`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster)|Enable occlusion checks for 2D objects, such as sprites in the scene.|
33
+
|[`Check For 3D Occulusion`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster)|Enable occlusion checks for 3D objects to prevent rays from passing through physical geometry.|
34
+
|[`Max Distance`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster)|Set the maximum ray distance for interaction detection in world space coordinates.|
35
+
|[`Blocking Mask`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster)|Define the layer mask used to check for occlusion when ray casting.|
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/about-layouts.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ A layout has two primary functions:
21
21
* Describe a certain memory layout containing input data.
22
22
* Assign names, structure, and meaning to the Controls operating on the data.
23
23
24
-
A layout can either be for a Control on a Device (for example, `Stick`), or for a Device itself (that is, anything based on [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html)).
24
+
A layout can either be for a Control on a Device (for example, `Stick`), or for a Device itself (that is, anything based on [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice)).
25
25
26
-
The Input System only loads layouts when they are needed (usually, when creating a new Device). To manually load a layout, you can use [`InputSystem.LoadLayout`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_LoadLayout_System_String_). This returns an [`InputControlLayout`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.html) instance, which contains the final, fully merged (that is, containing any information inherited from base layouts and/or affected by layout overrides) structure of the layout.
26
+
The Input System only loads layouts when they are needed (usually, when creating a new Device). To manually load a layout, you can use [`InputSystem.LoadLayout`](xref:UnityEngine.InputSystem.InputSystem). This returns an [`InputControlLayout`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout) instance, which contains the final, fully merged (that is, containing any information inherited from base layouts and/or affected by layout overrides) structure of the layout.
27
27
28
-
You can register new layouts through [`InputSystem.RegisterLayout`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterLayout_System_String_System_String_System_Nullable_UnityEngine_InputSystem_Layouts_InputDeviceMatcher__).
28
+
You can register new layouts through [`InputSystem.RegisterLayout`](xref:UnityEngine.InputSystem.InputSystem).
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/about-project-wide-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
@@ -20,7 +20,7 @@ Once you have created and assigned project-wide actions, the Input System Packag
20
20
21
21
## Using project-wide actions in code
22
22
23
-
The benefit of assign an Action Asset as the project-wide actions is that you can access the actions directly through the [`InputSystem.actions`](../api/UnityEngine.InputSystem.InputSystem.html) property directly, rather than needing to set up a reference to your Action Asset first.
23
+
The benefit of assign an Action Asset as the project-wide actions is that you can access the actions directly through the [`InputSystem.actions`](xref:UnityEngine.InputSystem.InputSystem) property directly, rather than needing to set up a reference to your Action Asset first.
24
24
25
25
For example, you can get a reference to an action named "Move" in your project-wide actions using a line of code like this:
The Input System supports multi-user management through the [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html) class. This comprises both user account management features on platforms that have these capabilities built into them (such as Xbox and PS4), as well as features to manage Device allocations to one or more local users.
7
+
The Input System supports multi-user management through the [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) class. This comprises both user account management features on platforms that have these capabilities built into them (such as Xbox and PS4), as well as features to manage Device allocations to one or more local users.
8
8
9
9
>__Note__: The user management API is quite low-level in nature. The stock functionality of Player Input Manager component (see [Player Input Manager](player-input-manager-component.md)) provides an easier way to set up user management. The API described here is useful when you want more control over user management.
10
10
11
-
In the Input System, each [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html) represents a human interacting with the application. For example, you can have multiple users playing a game together on a single computer or device (local multiplayer), where each user has one or more [paired Input Devices](#device-pairing).
11
+
In the Input System, each [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) represents a human interacting with the application. For example, you can have multiple users playing a game together on a single computer or device (local multiplayer), where each user has one or more [paired Input Devices](#device-pairing).
12
12
13
-
The [`PlayerInputManager`](player-input-manager-component.md) class uses [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html) internally to handle users.
13
+
The [`PlayerInputManager`](player-input-manager-component.md) class uses [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) internally to handle users.
14
14
15
15
>__Note__: In the editor, all `InputUser` instances are automatically removed when exiting play mode thus also removing any device pairings. In essence, `InputUser` is considered a player-only API.
To create custom Device commands (for example, to support some functionality for a specific HID), create a `struct` that contains all the data to be sent to the Device, and add a [`typeStatic`](../api/UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.html#UnityEngine_InputSystem_LowLevel_IInputDeviceCommandInfo_typeStatic) property to make that struct implement the [`IInputDeviceCommandInfo`](../api/UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.html) interface. To send data to a HID, this property should return `"HIDO"`.
7
+
To create custom Device commands (for example, to support some functionality for a specific HID), create a `struct` that contains all the data to be sent to the Device, and add a [`typeStatic`](xref:UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo) property to make that struct implement the [`IInputDeviceCommandInfo`](xref:UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo) interface. To send data to a HID, this property should return `"HIDO"`.
8
8
9
-
You can then create an instance of this struct and populate all its fields, then use [`InputDevice.ExecuteCommand<TCommand>`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_ExecuteCommand__1___0__) to send it to the Device. The data layout of the struct must match the native representation of the data as the device interprets it.
9
+
You can then create an instance of this struct and populate all its fields, then use [`InputDevice.ExecuteCommand<TCommand>`](xref:UnityEngine.InputSystem.InputDevice) to send it to the Device. The data layout of the struct must match the native representation of the data as the device interprets it.
0 commit comments