InputAction
TypeClass
NamespaceUnityEngine.InputSystem
PackageInput System (com.unity.inputsystem)
RelatedInputActionAsset, InputActionMap, InputActionReference, PlayerInput

InputAction

An InputAction is a named thing the player can do, like "Move", "Jump" or "Fire", in the new Input System. Keys and buttons (bindings) are attached to it. Your code reads the action and doesn't care which device triggered it.

A restaurant order. Your code is the kitchen: it only needs to hear "one Jump, please". Whether the order came from the counter (keyboard), the drive-through (gamepad) or an app (touchscreen) is the waiter's job. The bindings are the waiters. Add a new waiter (a new device binding) and the kitchen code doesn't change at all.

How the pieces fit

PieceWhat it isExample
Input Action AssetA file holding all your input setupInputSystem_Actions.inputactions
Action MapA group of actions used together. Enable one map at a time for different modes."Player", "UI", "Vehicle"
ActionOne thing the player can do"Jump" (Button), "Move" (Value, Vector2)
BindingA control that triggers the actionSpace key, gamepad South button
Composite bindingSeveral keys combined into one valueWASD → a Vector2
Bindings (devices)ActionsYour codeAction Map: PlayerSpace keyGamepad South buttonW A S D (2D composite)Gamepad left stickJumpButtonMoveValue, Vector2jump.WasPressedThisFrame()move.ReadValue<Vector2>()readsreads
Many bindings feed one action, and your code only talks to the action. Adding a new device means adding a binding; the code on the right never changes.

Action types

TypeUse for
ButtonPress/release: jump, fire, interact
ValueContinuous values: movement stick (Vector2), trigger pressure (float)
Pass ThroughLike Value, but reports every device separately. Advanced.

Properties

NameTypeDescription
namestringThe action's name.
enabledboolDisabled actions report nothing.
bindingslist of InputBindingAll bindings on this action.
actionMapInputActionMapThe map this action belongs to.

Methods

MethodReturnsDescription
ReadValue<T>()TCurrent value, e.g. ReadValue<Vector2>() for Move, ReadValue<float>() for a trigger.
WasPressedThisFrame()boolLike GetKeyDown.
WasReleasedThisFrame()boolLike GetKeyUp.
IsPressed()boolLike GetKey: true while held.
WasPerformedThisFrame()boolTrue the frame the action completed, respecting interactions like Hold or Tap.
Enable() / Disable()voidTurn on/off. Actions from your own assets start disabled; project-wide actions (InputSystem.actions) are enabled automatically.
GetBindingDisplayString(int bindingIndex)stringHuman-readable name, e.g. "Space" or "A". For "Press [E] to interact" prompts.

Events

EventFires when
startedInput began (button went down, stick left the center).
performedThe action "happened" (button pressed; for Value actions, every time the value changes).
canceledInput ended (released, stick back to center).

All three pass an InputAction.CallbackContext. Use ctx.ReadValue<T>() to get the value.

Code Samples

Polling (read every frame)

using UnityEngine;
using UnityEngine.InputSystem;

public class PollingPlayer : MonoBehaviour
{
    private InputAction move;
    private InputAction jump;

    void Awake()
    {
        move = InputSystem.actions.FindAction("Move");
        jump = InputSystem.actions.FindAction("Jump");
    }

    void Update()
    {
        Vector2 input = move.ReadValue<Vector2>();
        transform.position += new Vector3(input.x, 0f, input.y) * 5f * Time.deltaTime;

        if (jump.WasPressedThisFrame()) Debug.Log("Jump");
    }
}

Callbacks (react to events)

using UnityEngine;
using UnityEngine.InputSystem;

public class CallbackPlayer : MonoBehaviour
{
    [SerializeField] private InputActionReference fireAction; // pick the action in the Inspector

    void OnEnable()
    {
        fireAction.action.performed += OnFire;
        fireAction.action.Enable();
    }

    void OnDisable()
    {
        fireAction.action.performed -= OnFire;
    }

    private void OnFire(InputAction.CallbackContext ctx)
    {
        Debug.Log("Fire!");
    }
}

What happens at runtime

  1. Devices send events (key down, stick moved) to the Input System as they happen.
  2. By default, just before each frame's Update, the Input System processes those events and checks which bindings they match.
  3. Matching actions change phase (Waiting → Started → Performed → Canceled) and fire the corresponding C# events.
  4. The values you poll with ReadValue and WasPressedThisFrame reflect this processed state for the whole frame.

Common Mistakes

See also