/unity-dev:unity-2d-controllerfrom unity-dev
Implements 2D character movement for platformers and top-down games: jump physics, slopes, coyote time, moving platforms, wall slides, and grid-step movement.
Ships in unity-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A character left to the solver is a crate with a face. A dynamic body under gravity slides down slopes, sticks to walls by friction, bounces off corners and jumps a different height every time a contact lands on the take-off step. None of those are bugs in the physics. The fix is not a setting: the character stops being simulated, decides its own velocity, and uses the engine only to ask what is in the way.
| The situation | Read |
|---|---|
Kinematic or dynamic; Rigidbody2D.Slide; who owns the transform; a second writer | reference/model-choice.md |
| "The character slides down slopes", "it sticks to walls", "can't jump right at the edge", "falls through the moving platform": grounding, slopes, sliding downhill, one-way platforms and dropping through, moving platforms, coyote time, buffer, short hop, apex hang, dash, wall slide and wall jump, auto-run, abilities as data | reference/platformer.md |
| "The jump feels floaty": gravity and jump velocity from height and time; rise and fall gravity; why the apex is 2.85 and not 3; measuring it | reference/jump-maths.md |
| "Diagonal movement is faster": four-way, eight-way, analogue; the fast diagonal; acceleration and stopping; wall slide; twin-stick aim; screen clamp; knock-back | reference/topdown-free.md |
| One cell per step: commit then tween, key repeat, one buffered step, a refused step, pushing a pickup | reference/grid-step.md |
| "The sprite faces the wrong way": which way it faces; flipping against directional clips; the bridge that writes the Animator | reference/facing-and-animator-bridge.md |
| Reach tables, gap and ledge checks, the measuring script | unity-gameplay → reference/level-metrics.md |
| The input struct, the press latch and its buffer, a scripted driver; action assets, touch controls, rebinding | unity-input → reference/reading-input.md |
| Stick and pointer aim resolved to a direction | unity-input → reference/pointer-and-aim.md |
| Body types, simulation mode, interpolation; collider set-up, a callback that never fires | unity-physics-2d → reference/bodies-and-simulation.md |
| Casts, contact filters, a query that misses | unity-physics-2d → reference/queries-2d.md |
| Tile seams that catch the runner; composite colliders | unity-physics-2d → reference/tilemap-colliders.md |
| Platform effectors for dynamic bodies | unity-physics-2d → reference/effectors-and-joints.md |
| Which layers, and which pairs collide | unity-physics-2d → reference/layers-and-matrix.md |
| Cell coordinates on rectangular, isometric and hexagonal boards | unity-2d-grid → reference/coordinates.md |
| Occupancy, reservations, turn order, pathfinding | unity-2d-grid → reference/occupancy-and-turns.md |
| Following the runner; a camera that jitters behind it; confiners | unity-camera → reference/follow-2d.md |
| The state graph the bridge feeds, side-on | unity-animation → reference/sprite-state-graph.md |
| Directional trees fed by the facing | unity-animation → reference/blend-trees.md |
| Journeys that prove apex, coyote and buffer; recorders, situations, the probe, the never-inside invariant | unity-play-harness → reference/journeys.md |
Copy the resources/ files the model needs into a Runtime assembly beside RunInput.cs
(unity-input → resources/), and the journey from templates/ into a PlayMode test assembly
that also references the harness. The runtime files need no package — 2D physics and animation are
built-in modules; the journeys need com.unity.test-framework.
Every controller here is two halves that never mix:
RunInput ──► rules ──────────────► collision ─────────────► Rigidbody2D
(struct) PlatformerController2D PlatformerMotor2D MovePosition, once per step
what the runner wants what the level allows
coyote, cut, dash ground, slope, one-way, carry
| Half | Knows | Never knows |
|---|---|---|
Rules — resources/PlatformerController2D.cs | Input levels and presses, timers, abilities, gravity, jump velocity | Layers, casts, normals |
Collision — resources/PlatformerMotor2D.cs | Layers, the body's shape, what is ground, the platform under the feet | Input, gravity, what a jump is |
The rules call one method — Move(velocity, dt) — and read back four facts: Grounded,
WallSide, OnOneWay, Velocity. That seam is what lets a journey prove the jump, and lets the
collision half be replaced without touching a rule.
One model per character, chosen by constraint, written down before any code. If the project has
not named its view and movement model, unity-gameplay does that first.
| The game is | Model | Transform owner | Files |
|---|---|---|---|
| Side view under gravity: platformer, gated exploration, auto-runner | Kinematic body, moved to where casts allow | PlatformerMotor2D | PlatformerMotor2D.cs, PlatformerController2D.cs, MovingPlatform2D.cs |
| Seen from above, free movement: action-adventure, twin-stick, fixed-screen shooter | Dynamic body, gravity scale 0, velocity assigned every step | The solver, from one writer | TopDownMotor2D.cs |
| Cells: tactics, tile puzzle, RPG authored to the tile | The cell map; the transform is a tween | GridStepMover | GridStepMover.cs |
Why each, what each costs, and the grep that finds a second writer: reference/model-choice.md.
Rigidbody2D (Interpolate) + one BoxCollider2D (0.8 × 1.8) +
RunInputReader + PlatformerMotor2D + PlatformerController2D. The motor makes the body
kinematic. Set solid to the rooftop layer and oneWay to the platform layer — two layers,
never one.GameProbe.SetPlayerVelocity(() => run.transform, () => (Vector3)run.Velocity);
GameProbe.Register("grounded", () => run.Grounded);
GameProbe.SetState(() => run.State); // Grounded · Rising · Falling · WallSlide · Dash
templates/PlatformerJourneyTest.cs, which builds its own rooftops:| Test | Asserts |
|---|---|
Jump_ReachesTheConfiguredApex | A held jump peaks at apexHeight − jumpVelocity·dt/2 (2.85), within 0.05 |
Press_JustAfterTheLedge_StillJumps | A press spent 0.08 s after the last grounded step jumps |
Press_LongAfterTheLedge_IsRefused | A press at 0.16 s does not: coyote time is not a double jump |
Press_JustBeforeLanding_JumpsOnLanding | With a 0.15 s buffer, a press 0.10 s before the feet touch jumps from the roof |
| all four | JourneyInvariants2D.NeverInside2D reports nothing |
PLATFORMER_JOURNEY_BREAK=coyote, =buffer and =tap each turn
one test red. A journey nobody has seen fail proves nothing.unity-gameplay → scripts/jump_report.py against the
timeline the first test wrote, then build the level to the number it prints.The depot is the same loop with TopDownMotor2D and templates/TopDownJourneyTest.cs
(diagonal speed, wall slide with NeverInside2D, stopping distance); the sorting yard with
GridStepMover and two delegates.
Move is called from one place; nothing else assigns
transform.position, linearVelocity or a root-motion curve on that object. Launch pads,
hazards and conveyors hand a velocity to the controller (Push); they do not move the body.v.y = jumpVelocity. Added to a slope's or a lift's upward
velocity it is a different jump on every surface.v0·dt/2 under the designed one. Change the order and
every ledge in the game moves.TryUse. canJump && input.TryUse(Launch) buffers a press;
the reverse spends it in mid-air. The buffer length lives on the input source.Peek, presses with TryUse, both in FixedUpdate. Never a device, and
never a press rebuilt from held && !wasHeld.| Not here | Go to |
|---|---|
| Which perspective and movement model the game has; genre recipes; reach tables | unity-gameplay |
| Tilemap layers, rooms, chunks, level data | unity-2d-level |
| Sort order, sorting from above, 2D lights | unity-2d-rendering |
| Bones, skinned sprites, swapping parts | unity-2d-animation |
| Animator graphs, blend trees, events (the bridge feeds them) | unity-animation |
| Frames into clips, pivots | unity-2d-sprites |
| Pressing use on a switch, a gate or a pickup | unity-interaction |
| Health, hurt, invincibility frames and when a hit asks for knock-back | unity-combat |
Click-to-move: on a tile board unity-2d-grid (GridPathfinder); free 2D movement unity-navigation → reference/recipes.md §9 | |
| 3D characters and PhysX | unity-physics-3d |
Enemy behaviour, combat and interaction are not controllers: a sentry that patrols a ledge uses
PlatformerMotor2D with its own rules in place of PlatformerController2D, and what it decides
is unity-game-ai.
reference/facing-and-animator-bridge.md (opens in a new tab)reference/grid-step.md (opens in a new tab)reference/jump-maths.md (opens in a new tab)reference/model-choice.md (opens in a new tab)reference/platformer.md (opens in a new tab)reference/topdown-free.md (opens in a new tab)resources/AnimatorBridge2D.cs (opens in a new tab)resources/GridStepMover.cs (opens in a new tab)resources/MovingPlatform2D.cs (opens in a new tab)resources/PlatformerController2D.cs (opens in a new tab)resources/PlatformerMotor2D.cs (opens in a new tab)resources/TopDownMotor2D.cs (opens in a new tab)templates/PlatformerJourneyTest.cs (opens in a new tab)templates/TopDownJourneyTest.cs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tipoli5890/game-studio --plugin unity-dev51 skills in this plugin
/unity-2d-animationSkeletal 2D characters: PSB rig, bones and weights, sprite swaps, 2D IK (2D Animation package)./unity-2d-gridGrid tactics and tile puzzles, hex or square: move range, A* paths, line of sight, turns, undo./unity-2d-level2D level layout as data: Tiled/LDtk import, rooms, endless chunks, seeded levels, jump reachability./unity-2d-pixel-perfectBlurry, shimmering or seamed pixel art in Unity: Pixel Perfect Camera, import settings, snapping.