godot-2d-physics

Implement Godot 2D collision layers, masks, raycasting, and physics queries.

3|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/Totes-MickGOATs/mcgoats-game-template --skill godot-2d-physics-totes-mickgoats
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: godot-2d-physics
Source: https://github.com/Totes-MickGOATs/mcgoats-game-template/tree/main/engine/godot/skills/godot-2d-physics
Command: npx skills add https://github.com/Totes-MickGOATs/mcgoats-game-template --skill godot-2d-physics-totes-mickgoats

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides expert patterns and solutions for implementing robust 2D physics, collision detection, and interaction systems in Godot Engine, preventing common pitfalls and optimizing performance.

Core Features & Use Cases

  • Collision Layer/Mask Management: Programmatic and clear definition of physics interactions.
  • Area2D & Trigger Zones: Efficiently handle overlapping bodies and trigger events.
  • Raycasting & Queries: Implement line-of-sight, ground detection, and manual physics checks.
  • Use Case: Implement an enemy AI that detects players within its vision cone using raycasting, while ensuring projectiles only hit designated targets via precise collision layer configuration.

Quick Start

Use the godot-2d-physics skill to set up collision layers for a player character that detects enemies and world geometry.

Frequently Asked Questions about godot-2d-physics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up collision layers and masks in Godot 2D to ensure projectiles only hit designated targets?

Set up collision layers and masks in Godot 2D by programmatically defining physics interactions to ensure projectiles only hit designated targets. This approach prevents common pitfalls and optimizes overall game performance.

How does Area2D work for creating trigger zones and detecting overlapping bodies in Godot?

Area2D in Godot creates trigger zones by efficiently handling overlapping 2D bodies and triggering events upon interaction. This allows developers to detect when objects enter specific regions without relying on physical collisions.

What is the best way to implement line-of-sight detection and ground checks using raycasting in Godot?

Implement line-of-sight and ground detection in Godot using raycasting and manual physics queries. This technique enables enemy AI to detect players within vision cones and verify ground contact for character movement.

Can I use PhysicsDirectSpaceState2D for manual physics queries and custom physics integration in Godot 2D?

PhysicsDirectSpaceState2D in Godot 2D enables manual physics queries and custom physics integration through direct space state queries. This allows developers to execute complex collision detection checks on demand and cache results.

Why are my 2D physics interactions triggering incorrectly when using collision detection in Godot?

Incorrect 2D physics interactions and trigger events in Godot often result from misconfigured collision layers and masks. Properly managing these settings programmatically ensures overlapping bodies and raycasts interact only with designated targets.

Do I need prior Godot experience to use advanced 2D collision detection patterns?

Implementing advanced 2D collision detection patterns in Godot requires familiarity with the engine environment. This skill provides expert solutions for physics queries, Area2D triggers, and programmatic layer management, assuming foundational Godot knowledge.