Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Packages/com.unity.inputsystem/Documentation~/HowDoI.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A collection of frequently asked questions, and where to find their answers in t

> **Note:**
>
> If you're new to the Input System and have landed on this page looking for documentation, it's best to read the [QuickStart Guide](quick-start-guide.md), and the [Concepts](understanding-input.md) and [Workflows](workflows.md) pages, so that you can make sure you're choosing the best workflow for your project's input requirements.
> If you're new to the Input System and have landed on this page looking for documentation, it's best to read the [QuickStart Guide](quick-start-guide.md), and the [Concepts](understanding-input.md) and [Workflows](Workflows.md) pages, so that you can make sure you're choosing the best workflow for your project's input requirements.
>
> This is because there are a number of different ways to read input using the Input System, and many of the answers on this page give you the quickest but least flexible solution, and may not be suitable for a project with more complex requirements.

Expand All @@ -27,7 +27,7 @@ How do I...?
- [create my own custom devices?](hid-create-custom-layout.md)

- create a simple "Fire" type action?</br>
Use the same techniques shown for the "Jump" action in the [Workflows section](workflows.md)
Use the same techniques shown for the "Jump" action in the [Workflows section](Workflows.md)

- [require a button to be held down for some duration before triggering an action?](built-in-interactions.md#hold)

Expand Down
68 changes: 32 additions & 36 deletions Packages/com.unity.inputsystem/Documentation~/Installation.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,54 @@
---
uid: input-system-installation
---
# Installation guide
# Install the Input System package

This page describes how to install and activate the **Input System** package for your Unity Project.

> [!NOTE]
> 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.
>
> 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.
Install the Input System package and enable the input back end for your project.

## Install the package

To install the new Input System:

1. In the main menu of the Unity Editor, go to __Window__ > __Package Manager__ to open the Unity Package Manager.

2. Select **Unity Registry** from the navigation panel.

3. Select the __Input System__ package from the list.

The Package Manager automatically selects that version to install by default.

4. Select __Install__, follow any prompts to [enable the backends](#) for the new Input System.
Unity 6.1 and later include the Input System package in projects created from some templates.

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).
If your project doesn't include the Input System package, you can install it:

## Enable the new input backends
1. In the main menu, go to **Window** > **Package Manager**.
1. Go to **Unity Registry**.
1. From the package list, select **Input System**.
1. Select **Install**.
1. Follow any prompts to [enable the backends](#select-a-back-end).

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.
## Select a back end

When you install the Input System package, Unity will ask whether you want to enable the new backends. Click **Yes** to enable the new backends and disable the old backends. The Editor restarts during this process.
The Unity Editor has two back end options:

![Editor Restart Warning](Images/EditorRestartWarning.png)
- The Input Manager for backwards compatibility.
- The Input System package for new or upgraded projects.

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.
When you install the Input System package in your project, Unity asks whether to enable the Input System back ends. Select **Yes** to enable the Input System back ends and disable the Input Manager back ends. The Editor restarts to complete the change.

> [!NOTE]
> You can enable __both__ the old __and__ the new system at the same time. To do so, set **Active Input Handling** to **Both**.
To manually select a back end:

![Active Input Handling](Images/ActiveInputHandling.png)
1. In the main menu, go to **Edit** > **Project Settings** > **Player**.
1. In the **Other Settings** section, set **Active Input Handling** to select a back end:
- Input Manager (Old): Builds have the `ENABLE_LEGACY_INPUT_MANAGER=1` C# `#define`.
- Input System Package (New): Builds have the `ENABLE_INPUT_SYSTEM=1` C# `#define`.
- Both: Builds have both of the C# `#define`.

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.
The Editor restarts with a new back end.

## Install samples
## Import samples and demos

The package comes with a number of samples. You can install these directly from the Package Manager window in Unity (__Window > Package Manager__).
The Input System package includes several samples. To import a sample into your project:

To view the list of samples:
1. Go to **Window** > **Package Manager**.
1. Select the Input System package.
1. Select **Samples**.
1. To import a sample, select **Import** next to its name.

1. Select the package in the **Package Manager** window.
1. Select the __Samples__ tab.
1. Select __Import__ next to any sample name to import that sample into the current project.
For a more comprehensive demo, use the [Warriors](https://github.com/UnityTechnologies/InputSystem_Warriors) project.

![Install Samples](Images/InstallSamples.png)
## Additional resources

For a more comprehensive demo project for the Input System, refer to the [InputSystem_Warriors](https://github.com/UnityTechnologies/InputSystem_Warriors) GitHub repository.
* [Quickstart guide](quick-start-guide.md)
* [Migrate from the old input system](migrate-from-old-input-system.md)
* [Input System workflows](Workflows.md)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* [Introduction](index.md)
* [Installation](Installation.md)
* [Install the Input System package](Installation.md)
* [Concepts](understanding-input.md)
* [Workflows](workflows.md)
* [Workflows](Workflows.md)
* [Using the Actions Workflow](using-actions-workflow.md)
* [Using the PlayerInput Workflow](using-playerinput-workflow.md)
* [Using the Direct Workflow](using-direct-workflow.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Input System offers various ways to respond to input at runtime, from the re

## Recommended workflow

Working with the Input System's [recommended workflow](workflows.md) in your project involves two phases which you must approach in this order:
Working with the Input System's [recommended workflow](Workflows.md) in your project involves two phases which you must approach in this order:

1. Configure your project's actions.
2. Implement responses to actions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ uid: input-system-enable-correct-input-system

# Enable the correct input system

When installing the new Input System, Unity prompts you to enable the new input system and disable the old one. You can change this setting at any time later, by going to **Edit > Project Settings > Player > Other Settings > Active Input Handling**, [as described here](./Installation.md#enable-the-new-input-backends).
When installing the new Input System, Unity prompts you to enable the new input system and disable the old one. You can change this setting at any time later, by going to **Edit > Project Settings > Player > Other Settings > Active Input Handling**. For more information, refer to [Install the Input System package](./Installation.md#select-a-back-end).

There are scripting symbols defined which allow you to use conditional compilation based on which system is enabled, as shown in the example below.

Expand Down
17 changes: 9 additions & 8 deletions Packages/com.unity.inputsystem/Documentation~/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ The **Input System** allows your users to control your game or app using a devic

## Introduction

Unity supports input through two separate systems, one older, and one newer.
Unity supports input through two systems:

The older system, which is built-in to the editor, is called the [Input Manager](https://docs.unity3d.com/Manual/class-InputManager.html). The Input Manager is part of the core Unity platform and is the default, if you do not install the Input System package.
- The [Input Manager](https://docs.unity3d.com/Manual/class-InputManager.html), documented in the main Unity manual. This system is available for backward compatibility. For new projects, use the Input System.
- The Input System package described in this documentation. This is a more flexible system than the Input Manager and replaces it for new projects.

This **Input System package** is a newer, more flexible system, which allows you to use any kind of Input Device to control your Unity content. It's intended to be a replacement for Unity's classic Input Manager. It is referred to as the "Input" System Package, or just **The Input System**. To use it, you must [install it into your project using the Package Manager](Installation.md).
The Unity Editor 6.7 and newer installs the Input System package for projects created from some of the template. For empty projects and for older versions of the Editor, please install the package [using the Package Manager](Installation.md).

> [!TIP]
> During the installation process for the **Input System** package, the installer offers to automatically deactivate the older built-in system.

To get started, refer to the [Workflows](workflows.md) section to decide how to use Input:
To get started, refer to the [Workflows](Workflows.md) section to decide how to use the Input System:

* Using actions, which is the recommended workflow.
* Using both actions and the PlayerInput component, which provides features for callbacks and multiplayer.
* Directly read device states with a script for fast prototyping or single-platform applications.
- Using actions, which is the recommended workflow.
- Using both actions and the PlayerInput component, which provides features for callbacks and multiplayer.
- Directly read device states with a script for fast prototyping or single-platform applications.

For a demo project, refer to the [Warriors demo](https://github.com/UnityTechnologies/InputSystem_Warriors) on GitHub.

![Screenshot of the Input Actions Editor window displaying the default action map, Actions, and Action Properties. They are displayed in 3 columns side-by-side in that order.](Images/ActionsEditor.png)<br/>
*The Input Actions Editor, displaying some of the default actions that come pre-configured with the Input System package.*
*The Input Actions Editor, displaying several default actions from the Input System package.*
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ At runtime, the component adds a virtual [Mouse](xref:UnityEngine.InputSystem.Mo

Note that the resulting [Mouse](xref:UnityEngine.InputSystem.Mouse) input is visible in all code that picks up input from the mouse device. You can therefore use the component for mouse simulation elsewhere, not just with [InputSystemUIInputModule](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule).

To see an example of the Virtual Mouse in a project, see the [Gamepad Mouse Cursor sample](Installation.md#install-samples) included with the Input System package.
To see an example of the Virtual Mouse in a project, refer to the [Gamepad Mouse Cursor sample](Installation.md#import-samples-and-demos) included with the Input System package.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ This page is provided to help you match input-related API from Unity's old, buil

## Read the introductory documentation first

If you're new to the Input System package and have landed on this page looking for documentation, it's best to read the [QuickStart Guide](quick-start-guide.md), and the [Concepts](understanding-input.md) and [Workflows](workflows.md) pages from the introduction section of the documentation, so that you can make sure you're choosing the best workflow for your project's input requirements.
If you're new to the Input System package and have landed on this page looking for documentation, it's best to read the [QuickStart Guide](quick-start-guide.md), and the [Concepts](understanding-input.md) and [Workflows](Workflows.md) pages from the introduction section of the documentation, so that you can make sure you're choosing the best workflow for your project's input requirements.

This is because there are a number of different ways to read input using the Input System, and some of the directly corresponding API methods on this page might give you the quickest - but least flexible - solution, and may not be suitable for a project with more complex requirements.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ uid: input-system-optimize-controls

# Optimize controls

The [recommended workflow](workflows.md) is sufficiently optimized for most scenarios. However in some specialized situations when reading values directly from controls, you can make small performance gains by implementing some of the following techniques.
The [recommended workflow](Workflows.md) is sufficiently optimized for most scenarios. However in some specialized situations when reading values directly from controls, you can make small performance gains by implementing some of the following techniques.

## Avoiding defensive copies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ uid: quickstart-guide
---
# Quickstart Guide

This page has a brief description of how to quickly start using the Input System. The Input System has [multiple workflows](workflows.md) which you might prefer that offer different benefits. This quickstart guide shows a workflow which suits most common scenarios.
This page has a brief description of how to quickly start using the Input System. The Input System has [multiple workflows](Workflows.md) which you might prefer that offer different benefits. This quickstart guide shows a workflow which suits most common scenarios.

First, install the Input System package. For information on how to install the new Input System, refer to [Installation](Installation.md).
First, install the Input System package. For information on how to install the new Input System, refer to [Install the Input System package](Installation.md).

## Create and assign the default project-wide actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ uid: input-system-unity-remote

The Unity Remote is an app available for iOS and Android which allows using a mobile device for input while running in the Unity Editor. You can find details about the app and how to install it in the [Unity manual](https://docs.unity3d.com/Manual/UnityRemote5.html).

If you would like to try out the Unity Remote app, you can [install](Installation.md#install-samples) the "Unity Remote" sample that is provided with the Input System package.
If you would like to try out the Unity Remote app, you can [install](Installation.md#import-samples-and-demos) the "Unity Remote" sample that is provided with the Input System package.

> [!NOTE]
> Joysticks/gamepads are not yet supported over the Unity Remote. No joystick/gamepad input from the mobile device will come through in the editor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Input System package comes with a __Visualizers__ sample, which provides com

To install the sample:

1. Navigate to the Input System package in the Package Manager window (refer to [Installation](Installation.md)).
1. Navigate to the Input System package in the Package Manager window (refer to [Install the Input System package](Installation.md)).
1. Next to the __Visualizers__ sample, select __Import in project__.

The sample provides two visualizer components:
Expand Down
Loading