tea-x-random/unity-game-skills/unity-gameplay-systems

Claude Code and agent skill by tea-x-random/unity-game-skills

Trust tier 3
  • community
Source check pending

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-systems

SKILL.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)

  1. 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.
  2. 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.
  3. 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 to Edit, but is not done until it compiles clean — confirm with read_console(types=["error"]).
  4. 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_docs before writing C# you are unsure of. Trust order: reflection > project assets > docs > memory.

Workflow

  1. Read mcpforunity://editor/state (ready, not compiling, no domain reload pending) and mcpforunity://project/info (renderPipeline, activeInputHandler, UI stack) before any batch.
  2. Define the one-sentence loop: verb → objective → feedback → fail/retry.
  3. Decide 2D or 3D and pick a template (below). Load references/casual-templates.md for the step-by-step build recipe.
  4. Build the slice: input → state → entity → collision/physics → feedback → HUD hook. Smallest playable increment first.
  5. Tune feel: movement, camera follow, impact, juice, difficulty, restart loop. Load references/checklists/casual-game-feel.md.
  6. Keep hot paths allocation-free and update order explicit.
  7. Verify against references/checklists/new-game-definition-of-done.md before 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)

text
manage_editor(action="get_state") # confirm ready
manage_scene(action="create", name="Game", path="Assets/Scenes/Game.unity")
manage_scene(action="load", path="Assets/Scenes/Game.unity")
# camera + light usually exist; add the player + ground, then a script:
create_script(name="PlayerController", path="Assets/Scripts/") # compiles -> read_console
manage_gameobject(action="create", name="Player", primitive_type="Capsule")
manage_components(action="add", target="Player", component="PlayerController")
manage_editor(action="play") -> read_console -> manage_scene(action="screenshot") -> stop

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 ScriptableObject is 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/Destroy per frame), use Physics.RaycastNonAlloc / OverlapNonAlloc, avoid LINQ, string concatenation, boxing, and per-frame new in Update/FixedUpdate. Cache WaitForSeconds.
  • `== null`, not `is null`, for `UnityEngine.Object`. Unity overloads == to detect destroyed objects; is null bypasses 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 Editor asmdef.
  • Physics in `FixedUpdate`, input/visuals in `Update`. Move Rigidbody/Rigidbody2D with MovePosition/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.

csharp
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.EnhancedTouch;
using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch;
public class TouchInput : MonoBehaviour
{
void OnEnable() => EnhancedTouchSupport.Enable();
void OnDisable() => EnhancedTouchSupport.Disable();
void Update()
{
foreach (var t in Touch.activeTouches)
{
if (t.phase == UnityEngine.InputSystem.TouchPhase.Began)
OnTap(t.screenPosition); // tap
if (t.phase == UnityEngine.InputSystem.TouchPhase.Moved)
OnDrag(t.delta); // drag / swipe delta
}
}
void OnTap(Vector2 screenPos) { }
void OnDrag(Vector2 delta) { }
}

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)

  • SpriteRenderer for visuals; a Sprite Atlas for all gameplay sprites (one draw call, less memory).
  • Rigidbody2D + Collider2D for physics objects; set Rigidbody2D.bodyType = Kinematic for tap-moved pieces, Dynamic for falling/bouncing.
  • Triggers via OnTriggerEnter2D for pickups/matches; tap-picking via a camera raycast: Physics2D.OverlapPoint(worldPos) on Camera.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: CharacterController for tight non-physics control (runner lane-switch, jump), or Rigidbody (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: OnTriggerEnter for 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/tea-x-random/unity-game-skills/unity-gameplay-systems/badge)](https://verified-skill.com/skills/tea-x-random/unity-game-skills/unity-gameplay-systems)

Something wrong with this skill or its page? Tell us.