Tooluck logoTooluck
SKILL.md

godot-2d-movement

Agent skill fromgamedev-skills/awesome-gamedev-agent-skills

Implement 2D kinematic character movement in Godot 4.7 with CharacterBody2D and move_and_slide(): platformer run/jump with gravity, top-down 8-direction motion, slope handling, and reading collisions. Use when coding a 2D player or enemy controller, a platformer or top-down character, or fixing move_and_slide()/ is_on_floor() behavior in a .tscn with a CharacterBody2D.

How to install godot-2d-movement

install godot-2d-movement
# install the awesome-gamedev-agent-skills pack with the skills CLI
npx skills add gamedev-skills/awesome-gamedev-agent-skills

# or add only this skill to Claude Code: copy the folder

skills/godot/godot-2d-movement/

# into

~/.claude/skills/godot-2d-movement/ (all projects)

.claude/skills/godot-2d-movement/ (one project)

skills/godot/godot-2d-movement/SKILL.md

Apache-2.0Full file
1# Godot 2D Movement (4.x)
2
3Build responsive 2D character controllers with `CharacterBody2D` and the argument-less
4`move_and_slide()`. Targets **Godot 4.7**.
5
6## When to use
7
8- Use when scripting a 2D player/enemy that moves and collides: platformer (gravity +
9 jump) or top-down (free 8-direction), slope walking, or wall/floor detection.
10- Use when `move_and_slide()` "does nothing", the character sinks through floors, or
11 `is_on_floor()` is always false.
12
13**When *not* to use:** dynamic rigid bodies, areas, raycasts, collision layers →
14`godot-physics`; tile-based levels → `godot-tilemap`; full platformer game template →
15the `platformer` genre skill; engine-agnostic feel tuning → `physics-tuning`.
16
17## Core workflow
18
191. **Use `CharacterBody2D`** with a `CollisionShape2D` child. It is script-driven: it
20 does not fall or react to forces on its own.
212. **Set the `velocity` property, then call `move_and_slide()`** (no arguments in 4.x).
22 The method reads `velocity`, moves the body, slides along surfaces, and updates
23 `velocity` to reflect what actually happened.
243. **Do it in `_physics_process(delta)`** — `move_and_slide()` uses the physics step's
25 delta internally, so do not multiply `velocity` by `delta` yourself.
264. **Platformer:** add gravity to `velocity.y` each tick, jump by setting `velocity.y`
27 negative when `is_on_floor()`.
285. **Top-down:** build a direction from input and scale by speed; set
29…

Excerpt shown under the repository's Apache-2.0 license.

More skills in awesome-gamedev-agent-skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates