# create-2d-physics

Configures and repairs Unity 2D physics setups. It supports both the modern 2D Physics Core and legacy Rigidbody 2D workflows.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1100 installs · ★ 1149
- Author: Unity-Technologies
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Unity-Technologies/skills/tree/HEAD/skills/create-2d-physics/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/create-2d-physics

## What it does

Unity has two completely disconnected 2D physics architectures. Legacy relies on `Rigidbody2D` and `Collider2D`, while modern 2D Physics Core uses `PhysicsPose` or the `Unity.U2D.Physics` namespace. Because their codebases do not communicate, running instructions meant for the other stack yields silent failures. The skill probes the loaded assemblies first. If the project contains 3D physics, the agent stops immediately.

The workflow depends on the `unity command` CLI alongside `unity-cli` and `unity-pipeline`. Code fragments run through `eval` as statement blocks, which means `using` directives trigger compilation errors. Every type must be fully qualified. Before applying changes, the skill creates a rollback restore point. It also strips out temporary runtime logs after checking behavior. Testing the wrong physics route will compile cleanly but change nothing.

## Requirements
- Works with: Unity

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill create-2d-physics -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill create-2d-physics -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill create-2d-physics -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Unity-Technologies/skills create-2d-physics
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill create-2d-physics -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Unity-Technologies/skills --path skills/create-2d-physics
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill create-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/Unity-Technologies/skills/tree/HEAD/skills/create-2d-physics/SKILL.md

## When to use it
- configure components for the `com.unity.2d.physics` package
- resolve collision setups using legacy `Rigidbody2D`
- probe assemblies to detect the active 2D physics engine
- execute C# snippets safely through `eval` without namespace errors

## Example prompts
- Detect which 2D physics system this Unity project uses and configure the player collider
- Fix the CS0246 compilation error in our 2D Physics Core eval script
- Set up a legacy Rigidbody2D simulation baseline before changing gravity

## Similar
- [unity-physics](https://affpapa.org/en/nevibecode/skills/unity-physics.md) — skill · 5600 installs
- [physics-tuning](https://affpapa.org/en/nevibecode/skills/physics-tuning.md) — skill · 6900 installs
- [unity](https://affpapa.org/en/nevibecode/skills/unity.md) — skill · 908 installs
- [unity-game-developer](https://affpapa.org/en/nevibecode/agents/unity-game-developer.md) — subagent · 1122 installs
- [unity-cursor-ai-c-cursorrules-prompt-file](https://affpapa.org/en/nevibecode/rules/unity-cursor-ai-c-cursorrules-prompt-file.md) — rule · ★ 41011
- [unity-developer](https://affpapa.org/en/nevibecode/skills/unity-developer.md) — skill · 3000 installs

From the same set: [unity-technologies/skills](https://affpapa.org/en/nevibecode/by/unity-technologies/skills.md) — 31 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
