unity-input-system
БесплатноБез исполняемых скриптовНе проверенWires Unity 6.3 LTS player input with the Input System package: .inputactions assets, action maps, PlayerInput and control schemes. Use when input does…
от gamedev-skills★ 12 656 звёзд на GitHubОб этом скилле
Unity Input System
Read input through the Input System package (com.unity.inputsystem; Unity 6.3 LTS projects
use 1.20.x), which replaces the legacy Input.GetAxis/Input.GetKey Input Manager. Targets
Unity 6.3 LTS (6000.3).
When to use
- Movement, jump and fire input; action maps and control schemes; a
PlayerInputcomponent; reading aVector2from a stick or WASD; one set of actions for gamepad, keyboard and touch; the Unity rebinding API. Packages/manifest.jsonlistscom.unity.inputsystem, or the project has an*.inputactionsasset.
When not to use: input architecture across engines (buffering, remapping screens,
dead-zone design) → input-systems; moving the character once you have the vector →
unity-physics / unity-csharp-scripting.
Workflow
- Read Active Input Handling from the file.
ProjectSettings/ProjectSettings.assethasactiveInputHandler: 0(old Input Manager only),1(Input System only) or2(both). The package receives nothing at0, and any leftoverInput.GetAxiscall throws at1. GrepAssets/forInput.Getbefore choosing1; changing the value restarts the Editor, so tell the user. - Reuse the project-wide actions. New Unity 6 projects usually ship
Assets/InputSystem_Actions.inputactions, assigned as project-wide actions, with aPlayermap (Move,Look,Attack,Interact,Crouch,Jump,Previous,Next,Sprint) and aUImap. Add to it rather than creating a second asset. - Edit the asset as JSON when the Editor is closed. An
.inputactionsfile is JSON:maps[].actions[](name,type,expectedControlType) andmaps[].bindings[](pathsuch as<Keyboard>/space,action,groupsfor control schemes,isCompositeandisPartOfCompositefor WASD). Give each new action and binding a freshidGUID like the existing entries, keep the file valid JSON, and re-read it after writing. - Choose one way to read it:
- Project-wide actions in code,
InputSystem.actions.FindAction("Player/Move"): no asset reference to wire and the actions start enabled. The default for new code. PlayerInputcomponent when the project already uses it, or for local co-op (PlayerInputManagergives each joining device its own player).- An
InputActionReferenceor a separate asset when a tool or system needs its own actions; youEnable()andDisable()them yourself.
- Project-wide actions in code,
- Switch action maps for context (gameplay vs menu) instead of guarding every handler.
- Verify with the checks below.
Patterns
1. Project-wide actions, polled
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerControls : MonoBehaviour
{
private InputAction _move, _jump;
private void Awake()
{
_move = InputSystem.actions.FindAction("Player/Move");
_jump = InputSystem.actions.FindAction("Player/Jump");
}
private void Update()
{
Vector2 move = _move.ReadValue<Vector2>(); // continuous value
if (_jump.WasPressedThisFrame()) { /* jump */ } // edge, true for one frame
}
}
2. Callbacks and map switching
private InputActionMap _player, _ui;
private void Awake()
{
_player = InputSystem.actions.FindActionMap("Player");
_ui = InputSystem.actions.FindActionMap("UI");
}
private void Start() => _ui.Disable(); // project-wide actions enable every map at startup
private void OnEnable() => _player.FindAction("Attack").performed += OnAttack;
private void OnDisable() => _player.FindAction("Attack").performed -= OnAttack;
private void OnAttack(InputAction.CallbackContext ctx) { /* attack once per press */ }
public void OpenMenu() { _player.Disable(); _ui.Enable(); }
public void CloseMenu() { _ui.Disable(); _player.Enable(); }
3. PlayerInput with Send Messages
PlayerInput with Behavior = Send Messages calls On<ActionName>(InputValue) on scripts on
the same GameObject: void OnMove(InputValue v) => _move = v.Get<Vector2>();,
void OnJump(InputValue v) { if (v.isPressed) Jump(); }. Broadcast Messages also reaches
children; Invoke Unity Events and Invoke C# Events need no naming convention.
Verify
No Editor needed: parse the
.inputactionsJSON and confirm every name your code passes toFindAction/FindActionMapexists (for"Player/Jump", a mapPlayerwith an actionJump), and that composites have all their parts. ConfirmactiveInputHandlermatches the code.Tests: the package's
InputTestFixtureadds virtual devices and presses controls from code. Listcom.unity.inputsystemunder"testables"inPackages/manifest.jsonand addUnity.InputSystemandUnity.InputSystem.TestFrameworkto the test.asmdef(assembly setup is inunity-csharp-scripting):using NUnit.Framework; using UnityEngine.InputSystem; public class JumpInputTests : InputTestFixture {
Установить unity-input-system в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл unity-input-system?
Wires Unity 6.3 LTS player input with the Input System package: .inputactions assets, action maps, PlayerInput and control schemes. Use when input does nothing or fires under a menu, FindAction returns null, the old Input class throws, or Input.GetAxis code needs porting. Not for engine-neutral buffering, remapping or deadzones (`input-systems`) or jump feel (`platformer`).
Как установить скилл unity-input-system?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл unity-input-system запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic