tea-x-random/unity-game-skills/unity-gameplay-systems
Claude Code and agent skill by tea-x-random/unity-game-skills
- community
Checking that the SKILL.md file is still in the repository.
Build and iterate playable Unity gameplay systems for casual iOS games. Combines first-playable-slice setup, C# architecture, Input System touch controls, scene/prefab assembly via MCP, and game-feel tuning. Use for new project setup, first playable slice, game loops, entity/component systems, input (taps/swipes/drag), collision/physics 2D & 3D, scoring, spawning, object pooling, difficulty curves, camera follow, controls, game feel/juice (squash-stretch, screen shake, hit-stop, haptics), and 2D/3D casual mechanics (tappers, match, puzzle, endless runner, stacker).
Install
npx vskill@latest install tea-x-random/unity-game-skills/unity-gameplay-systemsSKILL.md
The same SKILL.md was published earlier as tea-x-random/unity-game-skills/unity-gameplay-systems.
Unity Gameplay Systems
Purpose
Stand up and evolve a verified playable loop for a casual iOS game: a controllable thing on screen, responsive touch input, deterministic update order, mobile-safe hot paths, and behavior proven in Play Mode — not a folder of design docs.
Use When
Starting a new casual game, repairing a weak prototype, adding mechanics/entities, designing C# architecture, wiring touch input, assembling scenes/prefabs, tuning camera/controls/difficulty, or adding juice.
Core Doctrine (shared with the unity-* set)
- Ship a verified playable slice early. Get a controllable object on screen that runs in Play Mode in the first session, then iterate. Never deliver only design docs.
- Keep gates lean for a solo dev. Ask at genuine branch points (concept, art direction, scope, billable actions); otherwise proceed with sensible defaults and batch decisions.
- Edit Unity through MCP, never raw YAML. Scenes/prefabs/components/assets go through
unity-mcp-bridge(manage_scene,manage_gameobject,manage_components,manage_prefabs,create_script) or generated Editor scripts. C# is plain text and safe toEdit, but is not done until it compiles clean — confirm withread_console(types=["error"]). - Verify APIs on Unity 6. The model's built-in Unity knowledge is ~2022.3. On Unity 6 (6000.x) the Input System and UI Toolkit differ. Call
unity_reflect/unity_docsbefore writing C# you are unsure of. Trust order: reflection > project assets > docs > memory.
Workflow
- Read
mcpforunity://editor/state(ready, not compiling, no domain reload pending) andmcpforunity://project/info(renderPipeline,activeInputHandler, UI stack) before any batch. - Define the one-sentence loop: verb → objective → feedback → fail/retry.
- Decide 2D or 3D and pick a template (below). Load
references/casual-templates.mdfor the step-by-step build recipe. - Build the slice: input → state → entity → collision/physics → feedback → HUD hook. Smallest playable increment first.
- Tune feel: movement, camera follow, impact, juice, difficulty, restart loop. Load
references/checklists/casual-game-feel.md. - Keep hot paths allocation-free and update order explicit.
- Verify against
references/checklists/new-game-definition-of-done.mdbefore claiming the slice is done.
Load references/csharp-patterns.md when writing C# (pooling, Input System actions, state machine, singleton manager, events).
Load references/headless-editor-recipes.md whenever building/testing WITHOUT a live Editor/MCP (batch-mode -executeMethod/-runTests runs): URP 17.5 2D asmdef split, headless URP activation, the NewScene prefab-ref invalidation + VerifyWired rule, synchronous ImportPackageImmediately, RenderPipeline.StandardRequest screenshots, and batch-run mechanics — all verified on a real 6000.5 build.
Project / scene setup via MCP (start the slice fast)
Primitives are fine to prove the loop — flag each one as a placeholder in the ledger. Registry-only rule for production visuals: all visible sprites/meshes/materials on gameplay prefabs must come from the approved-asset registry (unity-asset-pipeline, Assets/<Game>/Art/Approved/registry.yaml) — never wire raw generator output into a gameplay prefab. Logic prefabs may wrap registry assets. Primitives are allowed only while the registry is empty (or for a surface the registry doesn't cover yet) and flagged as placeholders in the ledger. A screenshot of only primitives is not a finished game.
Prefer full runtime construction over headless-wired serialized references
When building a scene/UI headlessly (no human in the Editor), prefer a single bootstrap MonoBehaviour that builds and wires everything in code over hand-wiring serialized object/asset references via SerializedObject.FindProperty. We were bitten twice: headless-wired references deserialize as NULL when the scene is reopened, and the resulting NullReferenceException at render time is silently swallowed inside `async void` methods — the console looks clean while the board renders blank.
Robust pattern: one bootstrap (e.g. AppRoot) that in Awake() builds the Camera, EventSystem, Canvas, all UI and all systems in code, and wires them via public Init(...) methods. The saved scene then needs only one GameObject, so there is nothing to lose on reopen.
- Self-healing SO fallback: if a referenced
ScriptableObjectis null,ScriptableObject.CreateInstance<T>()at runtime — give the SO sane default field values so it is fully usable with no asset on disk. - Runtime-built cameras need an explicit `AudioListener` (
AddComponent<AudioListener>()); there is no warning-free default, so audio silently dies otherwise.
C# best practices (firm rules)
- Cache `GetComponent` in `Awake`/`Start`, never in `Update`. Resolve all component refs once.
- No `Find` / `FindObjectOfType` / `SendMessage` in production. Wire references via
[SerializeField], a singleton manager, or events. Find-calls are scene-wide scans. - `[SerializeField] private` over public fields. Expose to the Inspector without breaking encapsulation. Public fields only for genuine cross-object contracts.
- Zero-allocation hot paths. Pool objects (never
Instantiate/Destroyper frame), usePhysics.RaycastNonAlloc/OverlapNonAlloc, avoid LINQ, string concatenation, boxing, and per-framenewinUpdate/FixedUpdate. CacheWaitForSeconds. - `== null`, not `is null`, for `UnityEngine.Object`. Unity overloads
==to detect destroyed objects;is nullbypasses it and misreports. - One Assembly Definition (`.asmdef`) per feature folder. Fast incremental compiles, enforced dependencies, shorter domain reloads. Keep Editor-only code in a separate
Editorasmdef. - Physics in `FixedUpdate`, input/visuals in `Update`. Move
Rigidbody/Rigidbody2DwithMovePosition/forces, not transform writes.
Expanded with snippets in references/csharp-patterns.md.
Input — Input System, not legacy Input
Use the Input System package (Action-based), not UnityEngine.Input. Check activeInputHandler in project/info; on Unity 6 verify the API with unity_reflect before writing. Drive an InputActionAsset or PlayerInput, and read touch via Touchscreen.current / EnhancedTouch.
For swipe detection, accumulate delta from Began to Ended and threshold the magnitude/direction. In the Editor, the mouse maps to touch for quick iteration.
Template A — 2D casual (tapper / match / puzzle)
SpriteRendererfor visuals; a Sprite Atlas for all gameplay sprites (one draw call, less memory).Rigidbody2D+Collider2Dfor physics objects; setRigidbody2D.bodyType = Kinematicfor tap-moved pieces,Dynamicfor falling/bouncing.- Triggers via
OnTriggerEnter2Dfor pickups/matches; tap-picking via a camera raycast:Physics2D.OverlapPoint(worldPos)onCamera.main.ScreenToWorldPoint. - Drive board/state with a small explicit state machine (
Idle → Selecting → Resolving → Spawning), not scattered booleans. - Orthographic camera; size the view to the board, anchor UI with safe areas (see
unity-ui-designer).
Full ordered recipe (MCP calls + scripts): references/casual-templates.md.
Template B — 3D casual (endless runner / stacker)
- Player:
CharacterControllerfor tight non-physics control (runner lane-switch, jump), orRigidbody(interpolation on) for physics-y stack/roll games. - World scroll: move the world toward the player or the player forward and recycle chunks. Spawn obstacles/coins from a pooled spawner ahead of the player; despawn behind.
- Collision:
OnTriggerEnterfor coins/power-ups,OnCollisionEnter/tagged trigger for hazards → kill → respawn / restart loop. - Difficulty: ramp scroll speed and spawn density over time/distance from a manager.
- URP mobile rendering and lighting via
unity-graphics.
Full ordered recipe: references/casual-templates.md.
Template C — grid / number puzzle (Sudoku, nonogram, match-grid)
A huge share of casual hits are grid puzzles. Build them like this (full worked recipe in references/grid-puzzle-template.md):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/unity-gameplay-systems/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tea-x-random/unity-game-skills/unity-gameplay-systems)