Skip to content
Agentmart
Submit a tool

godot-characterbody-2d

Expert patterns for CharacterBody2D including platformer movement (coyote time, jump buffering, variable jump height), top-down movement (8-way, tank…

Skill by bgrenat

IndexedLGPL-3.0★ 24
Write a review

Chalk Labs

Need help deploying godot-characterbody-2d?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/bgrenat-godot-characterbody-2d

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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. Use for player characters, NPCs, or enemies. Trigger keywords: CharacterBody2D, move_and_slide, is_on_floor, coyote_time, jump_buffer, velocity, get_slide_collision, one_way_platforms, state_machine.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/godot-characterbody-2d

What's inside

Skill name
godot-characterbody-2d
Description
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. Use for player characters, NPCs, or enemies. Trigger keywords: CharacterBody2D, move_and_slide, is_on_floor, coyote_time, jump_buffer, velocity, get_slide_collision, one_way_platforms, state_machine.
License
LGPL-3.0
Instructions
487 lines in SKILL.md · view on GitHub

Files (14)

  • SKILL.md
  • aerial_drift_acceleration.gd · scripts/
  • ceiling_bonk_detection.gd · scripts/
  • dash_controller.gd · scripts/
  • dash_state_controller.gd · scripts/
  • expert_physics_2d.gd · scripts/
  • frame_perfect_coyote_time.gd · scripts/
  • impulse_response_handler.gd · scripts/
  • performance_character_pooling.gd · scripts/
  • slope_stair_snapping.gd · scripts/
  • subpixel_movement_rounding.gd · scripts/
  • variable_jump_height.gd · scripts/
  • wall_jump_controller.gd · scripts/
  • wall_slide_jump_refined.gd · scripts/

SKILL.md (first lines)

# CharacterBody2D Implementation

Expert guidance for player-controlled 2D movement using Godot's physics system.

## 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 `move_and_slide()`** — `move_and_slide()` handles delta internally. Manual multiplication makes movement framerate-dependent [12].
- **NEVER use `global_position` updates for movement** — Use `velocity` and `move_and_slide()`. Direct position updates bypass collision detection and floor snapping.
- **NEVER ignore the return value of `move_and_slide()`** — While optional, checking `is_on_floor()` or `get_last_motion()` immediately after is critical for state logic.
- **NEVER rely on default `floor_snap_length` for fast stair-climbing** — Default snapping is too small for high-velocity characters. Use custom raycast-based stair logic for smooth transitions.
- **NEVER apply gravity while `is_on_floor()` is true** — Constant downward force on the floor can cause "micro-jitter" or prevent floor-snap from working correctly. Reset `velocity.y` to 0 or a small constant.
- **NEVER use `Area2D` for ground detection** — Real collisions (rays/shapecasts) are more precise. `is_on_floor()` is highly optimized; only augment it if necessary.
- **NEVER forget Ceiling Bonk detection** — If you don't reset `velocity.y` to 0 when `is_on_ceiling()`, the player will "float" against the ceiling until gravity pulls them down.
- **NEVER use high-precision physics for pixel art visuals** — Keep physics math high-precision, but round your Sprite nodal positions in `_process` to avoid visual sub-pixel jitter.
- **NEVER use `queue_free()` on characters every frame** — Use object pooling for bullets or enemies to avoid SceneTree performance spikes.
---

## Godot 4.7: CharacterBody2D

- Jolt 3D changes do not apply to 2D, but one-way **direction** on `CollisionShape2D` affects platformer feel — align with movement normals.

## Available Scripts

> **MANDATORY**: Read the appropriate script before implementing the corresponding pattern.

### [frame_perfect_coyote_time.gd](scripts/frame_perfect_coyote_time.gd)
Professional platformer mechanics: Coyote Time (jump after fall) and Input Buffering.

### [slope_stair_snapping.gd](scripts/slope_stair_snapping.gd)
Advanced procedural stair-climbing and smooth slope snapping logic.

### [variable_jump_height.gd](scripts/variable_jump_height.gd)
Customizable 'Short Hop' vs 'Full Jump' implementation based on input duration.

### [wall_slide_jump_refined.gd](scripts/wall_slide_jump_refined.gd)
Responsive Wall Slide and Wall Jump mechanics with proper push-back forces.

### [dash_state_controller.gd](scripts/dash_state_controller.gd)
State-based dash logic with invincibility frames and customizable cooldowns.

### [subpixel_movement_rounding.gd](scripts/subpixel_movement_rounding.gd)
Expert pattern for maintaining pixel-perfect visuals in low-res games while keeping smooth physics.

### [performance_character_pooling.gd](scripts/performance_character_pooling.gd)
Logic for optimizing 100+ active characters using visibility-based physics toggling.

### [impulse_response_handler.gd](scripts/impulse_response_handler.gd)
Expert handling of external forces (Knockback, Blow-back, Wind) integrated with `move_and_slide`.

### [aerial_drift_acceleration.gd](scripts/aerial_drift_acceleration.gd)
Precise air control and acceleration logic for professional platformer feel.

### [ceiling_bonk_detection.gd](scripts/ceiling_bonk_detection.gd)
Fixing 'sticky head' syndrome by correctly handling vertical momentum on ceiling hits.

### [expert_physics_2d.gd](scripts/expert_physics_2d.gd)
Complete platformer movement with coyote time, jump buffering, smooth acceleration/friction, and sub-pixel stabilization. Uses move_toward for precise control.

### [dash_controller.gd](scripts/dash_controller.gd)
Frame-perfect dash with I-frames, cooldown, and momentum preservation.

### [wall_jump_controller.gd](scripts/wall_jump_controller.gd)
Wall slide, cling, and directional wall jump with auto-correction.

> **Do First**: Read expert_physics_2d.gd for platformer foundation before adding dash/wall-jump.

---

## When to Use CharacterBody2D

**Use CharacterBody2D For:**
- Player characters (platformer, top-down, side-scroller)
- NPCs with custom movement logic
- Enemies with non-physics-based movement

**Use RigidBody2D For:**
- Physics-driven objects (rolling boulders, vehicles)
- Objects affected by forces and impulses

## Platformer Movement Pattern

### Basic Platformer Controller

```gdscript
extends CharacterBody2D

const SPEED := 300.0
const JUMP_VELOCITY := -400.0

# Get the gravity from the project settings
var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity")

func _physics_process(delta: float) -> void:
    # Apply gravity
    if not is_on_floor():
        velocity.y += gravity * delta
    
    # Handle jump
    if Input.is_action_just_pressed("jump") and is_on_floor():
        velocity.y = JUMP_VELOCITY
    
    # Get input direction
    var direction := Input.get_axis("move_left", "move_right")
    
    # Apply movement
    if direction:
        velocity.x = direction * SPEED
    else:
        velocity.x = move_toward(velocity.x, 0, SPEED)
    
    move_and_slide()
```

### Advanced Platformer with Coyote Time & Jump Buffer

```gdscript
extends CharacterBody2D

From bgrenat/godot-game-dev-studio, LGPL-3.0.

More from bgrenat/godot-game-dev-studio

Signals

Stars
24
Forks
3
Open issues
0
Last commit (this folder)
Oct 12, 2026 (19 days ago)
Last release
Oct 12, 2026 (19 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
LGPL-3.0
Website
powehi.eu
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from bgrenat

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get godot-characterbody-2d running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying godot-characterbody-2d?

CallGet help
Cite this page

godot-characterbody-2d skill. Agent Mart. https://agentmart.dev/skills/bgrenat-godot-characterbody-2d (last updated 2026-10-24)