Using the Hold or Tap Interaction In Unity’s Input System

Maurice Davis
3 min readDec 3, 2023

For this scene, we will need a plane and a sphere, through a rigid body into the sphere, and we can start setting up our interaction; in this example, we will use the hold interaction.

So here you can see our action map and action called jump setup and bound to the space key. With this set, we can now add our interaction.

To do this with the action selected we click the interaction plus tab and add a hold.

With our new hold added, we will leave the press at default and change the hold to one second. Once set, we can generate our input system script.

Scripting:

With our script created, we must create a new script for the player/ sphere. Add the input library, set our input variable, and create a bool. In the start function, we repeat the…

--

--