Input System Interactions Explained | Press, Hold, Tap, SlowTap, MultiTap - Unity

Uploaded by samyam
Share: Twitter Facebook
Today we go over Interactions in Unity's New Input System. I go what makes an interaction, how it impacts the actions, the individual actions themselves, code overview, interaction priority and multiple interactions, and custom interactions.

? Get the Source Code ?
https://www.patreon.com/posts/54177140

? Support Me ?
Patreon: https://www.patreon.com/samyg
Donate: https://ko-fi.com/samyam

►? Relevant Video Links ?
ᐅInput System Action Types Explained | Value, Passthrough, Button - Unity
https://youtu.be/DMUZfVSYJfs
ᐅInteractions Documentation
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Interactions.html
https://github.com/Unity-Technologies/InputSystem/blob/bcc89c252897385f1adb8e3fc320e7a7c442862b/Packages/com.unity.inputsystem/Documentation~/Interactions.md#default-interaction
ᐅInterface IInputInteraction Documentation
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.IInputInteraction.html
ᐅPress Interaction Example
https://github.com/Unity-Technologies/InputSystem/blob/stable/Packages/com.unity.inputsystem/InputSystem/Actions/Interactions/PressInteraction.cs

First I explain what an interaction is within Unity's Input System. Then I go over how the event callbacks work in the Input System, which is important to understand how interactions impact it. Then, I'll be going over each interaction individually, Press, Hold, Tap, SlowTap, and MultiTap. I explain their behavior and how they call the event callbacks in the action. Then I provide a visual explanation on the different interactions to better solidify the point.

After the main explanation is done, I go over priority of interactions, specifically having the interaction on the action versus the binding, and what happens when there are multiple interactions on the same action or binding. There is a visual example provided for that as well.

Finally, I go over a custom interaction which can be added via code or through the Input Action Asset that you create.

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we have recommended. While clicking these links won't cost you any money, they will help me fund my development projects while recommending great assets!

? Other Cool Unity Assets ?
ᐅPeek - Editor Toolkit: https://assetstore.unity.com/packages/tools/utilities/peek-editor-toolkit-149410
ᐅEditor Console Pro: https://assetstore.unity.com/packages/tools/utilities/editor-console-pro-11889
ᐅRainbow Folders 2: https://assetstore.unity.com/packages/tools/utilities/rainbow-folders-2-143526

►⏱️ Timestamps ⏱️
0:00 Intro
0:08 Install Input System
0:45 Input Action Asset
1:18 Interactions Intro
1:47 What is an interaction
2:22 Event Callbacks
4:13 Press Interaction
5:00 Hold Interaction
5:25 Tap Interaction
5:44 SlowTap Interaction
6:09 MultiTap Interaction
6:45 Visual Explanation of Interactions
7:44 Code for Visual Explanation
8:05 Interactions Visual Graph
9:20 Binding & Action Interactions
10:24 Interaction Priority
11:38 Script for Multiple Interactions
12:49 Visual Explanation of Interaction Priority
13:58 Add Bindings & Interactions through Code
14:57 Get Timeout of Interactions
15:29 Custom Interactions (Shows up in Input Action Asset!)
18:46 Outro

??THANK YOU TO ALL MY PATRONS ??

❯❯❯ My Links ❮❮❮
? Patreon ?
https://www.patreon.com/samyg
? Discord Server ?
https://discord.gg/mj3dSnmaZc
? Twitter ?
https://twitter.com/samyam_utube
? Facebook ?
https://www.facebook.com/samyam.youtube/
? Music ?
Ambient Gold
streambeats.com
? Like and Subscribe! ?

?️ Computer Setup ?️
*As an Amazon Associate I earn from qualifying purchases.
https://www.amazon.com/shop/samyam

#madewithunity #gamedev #unity