Creating Your First Actions

4 min readApr 3, 2025

Objective: An Overview on how to create diffrent types of actions using the Unity Input System Package.

Table of Contents

· What Are Actions?
Creating Actions
· Different Types of Bindings
Default
WASD Movement — Multiple keys Assigned to One Action
Hold Down Key to Sprint
Pressing Two Keys At Once — Binding with Modifiers

Check out the previous article on Action Maps to get started.

What Are Actions?

In Unity’s Input System, Actions represent high-level input events (e.g., “Jump” or “Move”) that are triggered by specific inputs from various devices, allowing for flexible and device-agnostic input handling.

Creating Actions

Actions are a subset of an action map. To create an Action, click on the + button. In this example, I’m making a “Fire” action for my Mech Action Map.

Actions automatically generate a default Binding, but this may not always be useful since different actions often require specific bindings. When learning, it’s beneficial to create bindings from scratch to gain a deeper understanding of the system.

Different Types of Bindings

Default

Let’s delete that and create our own Binding. When you click on the + button, you will notice a drop-down list for different types of Bindings, I’m sticking to the default option for this example.

In the Binding Properties, you can assign a Path. The path is the key or button you press to activate the action, here I select the Shift key by typing it in.

WASD Movement — Multiple keys Assigned to One Action

If I want my Mech to fly using WASD, but the default settings only support a single key or button, I can change this by navigating to Action Properties → Action Type and setting it to Value. This enables access to different Control Types, allowing for more flexible bindings.

Our Control Type will be set to D-pad.

Make sure to click on Save Asset to apply changes. Now, you should be able to Add Up/Down/Left/Right Composite. You may notice this action comes as a 2D Vector by default, that is because the official Unity Documentation refers to Vector 2D as “a composite that represents a 4-way button setup like the D-pad on gamepads,” which is exactly what we need for WASD-style controls.

Now you can type in your Bindings and you’re good to go.

Hold Down Key to Sprint

Input types that require the player to hold a key or button for a set duration before registering can be configured using Interactions.

In the Binding → Binding Properties → Interactions → + Button → Hold

Change the hold time to one second or as many as you like and now the Player will have to hold down the space key for 1 second before the Sprint Action is registered.

Pressing Two Keys At Once — Binding with Modifiers

If I want my Mech to land when I press two keys at once, I will need to add a Binding with One Modifier. Modifiers allow us to add a main key to press, and a secondary key that needs to be pressed simultaneously.

You can simply set your Binding respectively and you’re all set.

In the next article, we’ll take a look at scripting actions!

I hope this was helpful! Check out my portfolio, currently looking for opportunities in the video game industry!

--

--

Dennisse Pagán Dávila
Dennisse Pagán Dávila

Written by Dennisse Pagán Dávila

Software Engineer that specialize in Game Development. Currently looking for new opportunities. Portfolio: dennissepagan.com

No responses yet