unity-input-system
Что он делает
Этот скилл объясняет, как считывать ввод игрока в Unity с помощью современного пакета Input System. Он нужен разработчикам, которым нужно управление, работающее на клавиатуре, геймпадах и сенсорных экранах.
Когда использовать
- ✓Когда вы добавляете в игру Unity управление движением, прыжком или стрельбой.
- ✓Когда в проекте есть файл действий ввода или установлен пакет Input System.
- ✓Когда игрокам нужно менять клавиши управления или переключаться между геймпадом и клавиатурой.
Ссылка на скилл
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/unity/unity-input-system/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Настрой управление в Unity так, чтобы мой персонаж двигался клавишами WASD, левым стиком геймпада и сенсорным джойстиком.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Скилл ведет агента к настройке обработки ввода в проекте, определению действий ввода в файле, подключению их к персонажу и чтению значений либо через события, либо проверкой каждого кадра.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Unity Input System (new)
Read input through Unity's Input System package (com.unity.inputsystem 1.x; Unity 6.3 LTS
ships 1.20) — action-based, device-agnostic, rebindable. Targets Unity 6.3 LTS. This is the modern
replacement for the legacy Input.GetAxis/Input.GetKey Input Manager.
When to use
- Use when setting up movement/jump/fire input, defining an
.inputactionsasset with action maps and control schemes, wiring aPlayerInputcomponent, reading aVector2stick/WASD value, or handling gamepad + keyboard + touch from one set of actions. - Use when
Packages/manifest.jsoncontainscom.unity.inputsystemor the project has an*.inputactionsasset.
When not to use: rebindable-control architecture across engines → input-systems
(this skill is the Unity-specific API). Moving the character once you have the input vector
→ unity-physics / unity-csharp-scripting.
Core workflow
- Check Active Input Handling (Project Settings → Player). The package only receives
input when this is
Input System Package (New)orBoth.Bothis required if any oldInput.GetAxiscode remains. - Find or create the
.inputactionsasset. New Unity 6 projects usually already have one assigned as the project-wide actions (Project Settings → Input System Package; the template file isInputSystem_Actions.inputactions) — reuse it rather than adding a second asset. Add an action map (e.g.Gameplay), add actions (Move= Value/Vector2,Jump= Button,Fire= Button), and bind them to controls and composite bindings (WASD = 2D Vector composite). - Choose how to read it:
PlayerInputcomponent (designer-friendly) — drop it on the player, point it at the asset, pick a Behavior (Send Messages / Broadcast / Invoke Unity Events / Invoke C# Events). Best for single/local-coop players.- Project-wide actions in code (
InputSystem.actions.FindAction("Move")) — no asset reference to wire up, and the actions are already enabled. - Direct in code (
InputActionReference/InputActionAsset) — most control; youEnable()actions and read them. Best for systems and tools.
- Enable the actions/maps you read.
PlayerInputenables its default map automatically and project-wide actions start enabled; actions from any other asset must be.Enable()d (and disabled on teardown). - Switch action maps for context (gameplay ↔ UI/menu) instead of guarding every handler.
- Verify with the Input Debugger (Window → Analysis → Input Debugger) to confirm devices and that actions fire.
Patterns
1. PlayerInput with "Send Messages" (handlers on the same GameObject)
using UnityEngine;
using UnityEngine.InputSystem;
// PlayerInput (Behavior = Send Messages) calls On<ActionName>(InputValue) by name.
public class PlayerInputReceiver : MonoBehaviour
{
private Vector2 _move;
private void OnMove(InputValue value) => _move = value.Get<Vector2>(); // Move action
private void OnJump(InputValue value) { if (value.isPressed) Jump(); } // Button action
private void Update() { /* drive movement from _move */ }
private void Jump() { }
}
2. Reading an action directly in code (polling a value)
using UnityEngine;
using UnityEngine.InputSystem;
public class DirectMover : MonoBehaviour
{
[SerializeField] private InputActionReference moveAction; // assign the Move action
private void OnEnable() => moveAction.action.Enable(); // REQUIRED or it reads zero
private void OnDisable() => moveAction.action.Disable();
private void Update()
{
Vector2 move = moveAction.action.ReadValue<Vector2>(); // continuous value
transform.Translate(new Vector3(move.x, 0, move.y) * (5f * Time.deltaTime));
}
}
3. Project-wide actions (no asset reference)
using UnityEngine;
using UnityEngine.InputSystem;
public class ProjectWideMover : MonoBehaviour
{
private InputAction _move, _jump;
private void Awake()
{
// Looked up once; project-wide actions are preloaded and enabled by default.
_move = InputSystem.actions.FindAction("Move");
_jump = InputSystem.actions.FindAction("Jump");
}
private void Update()
{
Vector2 move = _move.ReadValue<Vector2>();
if (_jump.WasPressedThisFrame()) { /* jump */ }
}
}
4. Event callbacks + switching acti
Частые вопросы
Что такое действие ввода?
Действие ввода — это именованное управление, например Jump, которое может срабатывать от многих клавиш или кнопок.
Почему старые вызовы ввода иногда не работают?
Скилл отмечает, что настройка обработки ввода проекта должна включать новый Input System, чтобы пакет получал ввод.
Покрывает ли он движение персонажа?
Не полностью. Физику движения покрывают отдельные скиллы Unity.
Подробности
Оригинальное описание автора
Wire player input in Unity 6.3 LTS with the Input System package: Input Actions, action maps, the PlayerInput component, and reading values via callbacks or polling. Use when the project has a .inputactions asset or com.unity.inputsystem, or when the user mentions the Unity Input System, InputAction, action maps, PlayerInput, control schemes, or rebinding.
Популярность
- Звёзды на GitHub
- 6.6k
- Место в рейтинге
- #13847
- Лицензия
- Apache-2.0
- Обновлён
- 28.10.2026
Комментарии
- …
Другие скиллы из этого репозитория
router
6.6kПомогает агенту выбрать нужный скилл для игровой разработки, определив движок и тип задачи.
ai-behavior-trees-utility-ai
6.6kПомогает агенту построить дерево поведения и систему утилитарного ИИ для врагов и персонажей игры, которые выбирают действия по приоритету и оценке.
audio-design
6.6kУчит агента сведению звука в играх: шины, громкость в децибелах, приглушение под диалоги, адаптивная музыка и вариации звуковых эффектов.
camera-systems
6.6kПомогает агенту создавать игровые камеры, которые плавно следуют за объектом, остаются в пределах уровня и вращаются или осматриваются в 3D.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.