# godot-raycasting-queries

godot-raycasting-queries is a Claude Code skill with Godot physics query blueprints for RayCast, ShapeCast, and DirectSpaceState. It helps implement hit detection, mouse picking, and AI vision cones.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 328 installs · ★ 983 repo stars
- 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-raycasting-queries/SKILL.md
- Updated: 2026-10-16
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/godot-raycasting-queries

## What it does

This skill provides structured GDScript blueprints for 2D and 3D physics queries. It guides the agent on bypassing node overhead with direct `intersect_ray` calls, handling screen-to-world clicks, and calculating laser reflections.

Included scripts handle footing checks via `ShapeCast`, AI field-of-view scanners, and piercing projectile chains. Physics queries run strictly within `_physics_process` because querying `direct_space_state` during normal frames triggers thread safety issues while Godot locks the simulation. The recipes enforce caster RID exclusion to stop rays from hitting the originating body.

## Requirements
- Works with: Godot

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install thedivergentai/Game-Dev-Agentic-Skills skills/godot-raycasting-queries
```

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

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-raycasting-queries -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-raycasting-queries/SKILL.md

## When to use it
- implement 3D mouse picking from viewport coordinates
- prevent self-collision by filtering out caster RIDs
- detect uneven ground contact using ShapeCast volumes
- build piercing projectiles that record multiple hits along a line

## Example prompts
- Set up screen-to-world raycasting for clicking 3D objects with PhysicsRayQueryParameters3D.
- Implement character ground detection using ShapeCast3D instead of thin rays.
- Create an AI visibility cone using raycasts while excluding the agent RID.

## Similar
- [godot-physics](https://affpapa.org/en/nevibecode/skills/godot-physics.md) — skill · 12400 installs
- [godot-2d-movement](https://affpapa.org/en/nevibecode/skills/godot-2d-movement.md) — skill · 12000 installs
- [godot-optimization](https://affpapa.org/en/nevibecode/skills/godot-optimization.md) — skill · 733 installs
- [scenario-godot-3d-world](https://affpapa.org/en/nevibecode/skills/scenario-godot-3d-world.md) — skill · 461 installs
- [scenario-godot-animation](https://affpapa.org/en/nevibecode/skills/scenario-godot-animation.md) — skill · 458 installs
- [godot](https://affpapa.org/en/nevibecode/skills/godot.md) — skill · 3 installs

From the same set: [thedivergentai/game-dev-agentic-skills](https://affpapa.org/en/nevibecode/by/thedivergentai/game-dev-agentic-skills.md) — 100 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
