Expert patterns for CharacterBody2D including platformer movement (coyote time, jump buffering, variable jump height), top-down movement (8-way, tank controls), collision handling, one-way platforms, and state machines.
Expert patterns for CharacterBody2D including platformer movement (coyote time, jump buffering, variable jump height), top-down movement (8-way, tank controls), collision handling, one-way platforms, and state machines.
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Claude CodeNot declared
CursorNot declared
CodexNot declared
GitHub CopilotNot declared
WindsurfNot declared
Gemini CLINot declared
ClineNot declared
OpenCodeNot declared
Repository health
Stars678
LicenseLICENSE
Default branchmain
Open issues0
Status
Active
Package contents
Files included with this skill beyond the listing page.
skill mdSKILL.md13,397 B
docsSUMMARY.md4,011 B
History
First seen on skills.sh
First recorded snapshot · 381 installs
SKILL.md
CharacterBody2D Implementation
Expert CharacterBody2D feel systems — not beginner moveandslide tutorials.
NEVER Do
NEVER use RigidBody2D for standard player controllers — RigidBody is for physics-simulated objects. For responsive, feel-driven player movement, always use CharacterBody2D.
NEVER multiply velocity by delta before moveandslide() — moveandslide() handles delta internally. Manual multiplication makes movement framerate-dependent.
NEVER use globalposition updates for gameplay movement — Use velocity + moveand_slide(). Direct position hacks bypass collision, floor snap, and one-way rules.
NEVER "fall through" one-ways by nudging position.y — Use one-way collision shapes + layer/mask (and temporary mask disable / collide-with-areas patterns). See godot-2d-physics.
NEVER ignore floor/wall/ceiling state right after moveandslide() — isonfloor(), isonwall(), isonceiling(), and slide collisions drive coyote, wall jump, and bonk logic.
NEVER rely on default floorsnaplength for fast stair-climbing — Default snapping is too small for high-velocity characters. Use custom raycast-based stair logic.
NEVER apply gravity while isonfloor() is true — Constant downward force causes micro-jitter and fights floor-snap. Reset velocity.y on land.
NEVER use Area2D as primary ground detection — Prefer isonfloor() / shapecasts; Areas are for triggers, not floor truth.
NEVER forget ceiling bonk — Reset velocity.y when isonceiling() or the player floats into the ceiling until gravity wins.
NEVER round physics positions for pixel art — Keep physics high-precision; round sprite positions in process only ([subpixelmovementrounding.gd](scripts/subpixelmovement_rounding.gd)).
NEVER spam queuefree() for hordes — Pool bullets/enemies when spawn/despawn is frequent ([performancecharacterpooling.gd](scripts/performancecharacter_pooling.gd)).
When to Use CharacterBody2D
Need
Body
Feel-driven player / NPC / enemy locomotion
CharacterBody2D
Rolling debris, ragdoll-ish props, force piles
RigidBody2D
Static level colliders
StaticBody2D / TileMapLayer physics
Decision Tree → MANDATORY Scripts
Task
Do First
Then (optional)
Do NOT Load
Platformer foundation (coyote, buffer, accel/friction)
Golden path: Read expertphysics2d.gd first. Add dash/wall/jump scripts only after that controller is in place. Do not re-inline coyote/buffer/accel loops in the scene when the script already owns them.
One-Way Platforms (correct recipe)
Author one-way on the platform collider (CollisionShape2D one-way / TileSet physics one-way), not by teleporting the player.
Put platforms and player on explicit collision layers/masks so drop-through can temporarily clear the platform bit (or disable collide-with) while holding down + jump — then restore next physics frames.
Keep drop-through on the physics tick; never bypass moveandslide with position nudges.
Monitor isonwall() while falling; scale velocity.y by a friction factor (optionally from tile custom data) instead of a binary wall-slide bool. Prefer [wallslidejumprefined.gd](scripts/wallslidejumprefined.gd) over a bespoke cling fork.
2. Animation-Driven Movement (Root Motion)
Pull AnimationTree.getrootmotionposition(), convert to 2D, assign velocity = motion / delta, then moveand_slide(). Keeps feet locked to authored clips; pair with godot-2d-animation.
3. Game-Feel Profiler (Jump Arcs)
Debug-draw historical positions + current velocity in draw() to visualize apex, coyote, and buffer windows while tuning exports on expertphysics2d.gd — [gamefeelprofiler.gd](scripts/gamefeel_profiler.gd).
MANDATORY for top-down/tank recipes, moving platforms, slide-collision response, and gotcha tables: [movement-recipes.md](references/movement-recipes.md). Do NOT Load when expertphysics2d.gd already covers your platformer scope.
Reference
Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing work to a peer domain — do not preload the whole lattice.
Official Documentation
Using CharacterBody2D — Canonical moveand_slide / floor-wall-ceiling contracts; do not set position for gameplay motion.
CharacterBody2D — API for velocity, snap, ison_floor / wall / ceiling, and slide-collision accessors.
Physics introduction — Why CharacterBody vs RigidBody/StaticBody, and how layers/masks gate every contact.
Collision shapes (2D) — Capsule/box sizing and why scaled CollisionShape2D nodes corrupt normals and floor detect.
2D movement — Input axes into velocity for top-down and platformer starters before juice systems.
Kinematic character (2D) — Classic slide/collision loop patterns that still inform custom stair and slope handling.
Troubleshooting physics issues — One-way platforms, tunneling, and jitter diagnoses that show up in CharacterBody feel bugs.
Ray-casting — Direct-space rays for stair snaps, ledge checks, and ground probes beyond isonfloor().
KinematicCollision2D — Per-slide normals/remainders from getslide_collision for wall jumps and ceiling bonks.