# godot-2d-physics

Guides coding agents through Godot 2D physics architecture. Prevents common pitfalls across collision layers, raycasts, and custom space queries.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 516 installs · ★ 893
- Author: thedivergentai
- License: LGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/tree/HEAD/skills/godot-2d-physics/SKILL.md
- Updated: 2026-10-16
- HTML: https://affpapa.org/en/nevibecode/skills/godot-2d-physics

## What it does

This skill provides strict guardrails for Godot 2D physics implementation. It stops the agent from scaling `CollisionShape2D` nodes directly and prevents mixing up `collision_layer` with `collision_mask`. Bodies must stay inside `_physics_process()`.

The skill routes tasks to specialized GDScript files instead of generic code. It points the agent to `physics_server_swarm.gd` for thousands of projectiles, `shapecast_aoe.gd` for combat volumes, and `raycast_vision_stack.gd` for vision cones. Polling `get_overlapping_bodies()` every frame is replaced with signal caching.

Mind the low-level cleanup. Any RID created through `PhysicsServer2D` requires manual deletion, or memory will leak permanently. Continuous collision detection should also stay disabled on slow props to prevent unnecessary CPU load.

## Requirements
- Works with: Godot

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-2d-physics -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/godot-2d-physics/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/godot-2d-physics/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-2d-physics -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/godot-2d-physics/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-2d-physics -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/godot-2d-physics/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install thedivergentai/Game-Dev-Agentic-Skills godot-2d-physics
```

2. **Manually: put the files in place**
- File: `.github/skills/godot-2d-physics/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-2d-physics -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/thedivergentai/Game-Dev-Agentic-Skills --path skills/godot-2d-physics
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/godot-2d-physics/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-2d-physics -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/tree/HEAD/skills/godot-2d-physics/SKILL.md

## When to use it
- configure collision layer and mask matrices
- handle high-density swarms using PhysicsServer2D
- query manual raycasts mid-frame with force_raycast_update
- eliminate physics jitter on high-refresh displays

## Example prompts
- Configure separate collision layers and masks for enemies and walls in Godot
- Implement line-of-sight raycasting using PhysicsDirectSpaceState2D
- Move bullet swarm logic from Area2D to PhysicsServer2D

## Similar
- [godot-physics](https://affpapa.org/en/nevibecode/skills/godot-physics.md) — skill · 6300 installs
- [cli-anything-godot](https://affpapa.org/en/nevibecode/skills/cli-anything-godot.md) — skill · 548 installs
- [godot-gdscript](https://affpapa.org/en/nevibecode/skills/godot-gdscript.md) — skill · 6500 installs
- [godot-best-practices](https://affpapa.org/en/nevibecode/skills/godot-best-practices.md) — skill · 2100 installs
- [godot-prompter](https://affpapa.org/en/nevibecode/plugins/godot-prompter.md) — plugin · ★ 867
- [godot-mcp-enhanced](https://affpapa.org/en/nevibecode/mcp/godot-mcp-enhanced.md) — MCP server · ★ 103

From the same set: [thedivergentai/game-dev-agentic-skills](https://affpapa.org/en/nevibecode/by/thedivergentai/game-dev-agentic-skills.md) — 61 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
