DOCF-6395 content model re-org - Interactions by siobhan-unity · Pull Request #2120 · Unity-Technologies/InputSystem · GitHub
Skip to content
Merged
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
32 changes: 9 additions & 23 deletions Packages/com.unity.inputsystem/Documentation~/Interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
* [Input Action Assets](ActionAssets.md)
* [Input Bindings](ActionBindings.md)
* [Interactions](Interactions.md)
* [Introduction to interactions](introduction-interactions.md)
* [Apply interactions to Bindings](apply-interactions-bindings.md)
* [Apply Interactions to Actions](apply-interactions-actions.md)
* [Predefined interactions](predefined-interactions.md)
* [Default Interactions](default-interactions.md)
* [Built-in Interactions](built-in-interactions.md)
* [Write custom interactions](write-custom-interactions.md)
* [Devices](Devices.md)
* [Controls](Controls.md)
* [Processors](Processors.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Apply Interactions to Actions

Applying Interactions directly to an Action is equivalent to applying them to all Bindings for the Action. You can use this instead of manually adding the same Interaction(s) to multiple Bindings.

To apply Interactions to individual Bindings, refer to [Apply Interactions to Bindings](apply-interactions-bindings.md).

If you apply Interactions to both an Action and its Bindings, then the effect is the same as if the Action's Interactions are on the list of Interactions on each of the Bindings. This means that the Input System applies the Binding's Interactions first, and then the Action's Interactions.

## Apply Interactions to Actions via the Editor

To apply interactions via the Input Action Editor:

1. Select an Action to edit, so that the right pane of the window displays the properties for that Action.
1. Select the plus icon on the __Interactions__ foldout to open a list of all available Interactions types.
1. Select an Interaction type to add an Interaction instance of that type. The Interaction now appears in the __Interactions__ foldout.
1. If the Interaction has any parameters, you can now edit them at this stage.

## Apply Interactions to Actions via code

If you create your Actions in code, you can add Interactions like this:

```CSharp
var Action = new InputAction(Interactions: "tap(duration=0.8)");
```
Loading