Start with actions, not keys

The new Input System works best when you describe meaningful game actions—move, jump, interact—instead of hard-coding individual keys. The same action can then be bound to a keyboard, gamepad, or touch control.

Unity recommends an action-based workflow and documents PlayerInput as a companion for callbacks and multiplayer scenarios. That is also a sensible baseline for a small single-player prototype.

A minimal setup order

Begin with one Action Asset and one PlayerInput component. Multiple input handlers in one scene are a common source of duplicate calls.

  1. Install the Input System package and verify Active Input Handling when needed.
  2. Create a Gameplay Action Map with semantic actions such as Move (Vector2) and Jump (Button).
  3. Add one PlayerInput component to the player object and attach the Action Asset.
  4. Keep action Enable and Disable calls paired in code.
using UnityEngine;
using UnityEngine.InputSystem;

public class MoveProbe : MonoBehaviour
{
    [SerializeField] private InputActionReference move;

    private void OnEnable() => move.action.Enable();
    private void OnDisable() => move.action.Disable();

    private void Update()
    {
        Vector2 direction = move.action.ReadValue<Vector2>();
        Debug.Log(direction);
    }
}

Four checks when input stays silent

Before rewriting a script, check whether the action is enabled, the intended map is active, the Game view owns focus, and only one PlayerInput is handling the action.

Reading device state directly can be useful for a quick prototype, but an action-first structure is easier to extend to rebinding and multiple devices.

Official documentation checkedUnity Input System 1.20 Manual ↗