dev-input-system

Architect Unity Input System action maps and abstract input providers for cross-platform games.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/Unity-UPM-Packages/Antigravity-skills --skill dev-input-system-unity-upm-packages
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dev-input-system
Source: https://github.com/Unity-UPM-Packages/Antigravity-skills/tree/main/.agents/skills/dev-input-system
Command: npx skills add https://github.com/Unity-UPM-Packages/Antigravity-skills --skill dev-input-system-unity-upm-packages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Gameplay code that queries Unity input directly becomes untestable, hard to port between keyboard, gamepad, and touch, and tightly coupled to hardware. This Skill provides an architecture pattern that routes all input through an IInputProvider abstraction layer. ## Core Features & Use Cases - Input Abstraction Layer: Defines an IInputProvider interface so no gameplay system queries InputAction directly, enabling mocking in unit tests and input recording/replay. - Action Map Design: Organizes Gameplay and UI action maps in the .inputactions asset with code-driven context switching for gameplay, pause menus, cutscenes, and dialogue. - Mobile Touch Patterns: Implements virtual joysticks, touch action buttons via IPointerDownHandler, and swipe detection using EnhancedTouch from the new Input System. - Use Case: When building a cross-platform Unity game, use this Skill to design the input architecture so the same gameplay code runs on PC keyboard, console gamepad, and mobile touch without modification. ## Quick Start Design the input handling architecture for my Unity game using the new Input System with an IInputProvider abstraction and separate Gameplay and UI action maps.

Frequently Asked Questions about dev-input-system

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure input handling in Unity's new Input System?▼

Route all input through an IInputProvider interface instead of querying InputAction directly from gameplay code. Organize actions into Gameplay and UI action maps, subscribe to performed/canceled callbacks, and cache values rather than polling each frame.

How to implement a virtual joystick for mobile Unity games?▼

Implement IPointerDownHandler, IDragHandler, and IPointerUpHandler on a UI element, clamp the drag delta to a max radius, and fire a normalized Vector2 event. The InputProvider consumes this event rather than the joystick writing movement state directly.

Should I use Input.GetTouch or EnhancedTouch for Unity mobile gestures?▼

Use EnhancedTouch from the new Input System, never the legacy Input.GetTouch. Enable EnhancedTouchSupport and subscribe to Touch.onFingerDown and Touch.onFingerUp to detect gestures like swipes with a minimum distance threshold.

How do I test Unity input-dependent code without hardware?▼

Create a MockInputProvider implementing the same IInputProvider interface with settable properties and Simulate methods that raise the input events. Unit tests inject the mock instead of the real InputProvider, so no device simulation is needed.

How do I switch between gameplay and menu input in Unity?▼

Enable and disable action maps in code when game state changes: enable the Gameplay map during play, switch to the UI map for pause menus and dialogue, and disable all maps during cutscenes. This prevents gameplay actions from firing while navigating menus.