godot-2d-physics

Provides Godot 2D physics patterns for collisions, area triggers, and space queries.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/yyypasserby1102/ghost --skill godot-2d-physics-yyypasserby1102
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: godot-2d-physics
Source: https://github.com/yyypasserby1102/ghost/tree/main/.opencode/skills/godot-2d-physics
Command: npx skills add https://github.com/yyypasserby1102/ghost --skill godot-2d-physics-yyypasserby1102

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Godot 2D developers frequently struggle to implement robust collision handling, Area2D triggers, and efficient PhysicsDirectSpaceState2D queries. This Skill provides ready-made patterns and guidance to streamline 2D physics workflows.

Core Features & Use Cases

  • Collision layer/mask management with clear examples
  • Area2D trigger patterns for body_entered/body_exited with safe tracking
  • RayCast2D usage and PhysicsDirectSpaceState2D queries for precise sensing
  • Practical use cases across platformers, shooters, and AI sensing
  • Performance tips for high-velocity objects and large numbers of entities

Quick Start

Instantiate the provided Godot 2D physics patterns in your project and adapt them to your gameplay scenarios.

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 for precise detection?

Collision layers and masks in Godot 2D are managed by assigning specific layer values to physics bodies and configuring mask values to detect desired intersections. This Skill provides clear examples and scripts to configure collision layers and masks, ensuring precise collision detection across complex game entities.

What's the best way to track Area2D body_entered and body_exited triggers safely?

The best way to track Area2D body_entered and body_exited triggers safely is by using dedicated tracking patterns that maintain state accurately during physics processing. This Skill provides ready-made Area2D trigger patterns with safe tracking logic to prevent signal processing errors during concurrent physics updates.

How do I use PhysicsDirectSpaceState2D and RayCast2D for direct space queries?

PhysicsDirectSpaceState2D and RayCast2D perform direct space queries by casting rays into the physics world to gather precise collision information. This Skill provides usage patterns for RayCast2D and PhysicsDirectSpaceState2D queries to enable precise sensing for AI systems and gameplay mechanics.

Does this 2D physics approach work for high-velocity objects like bullets in shooters?

Yes, this 2D physics approach works for high-velocity objects in shooters by applying specific performance patterns. This Skill includes performance tips and guidance for handling high-velocity objects and large numbers of entities to prevent tunneling and maintain efficient physics queries.

Why does my Godot 2D collision detection fail when processing many entities?

Godot 2D collision detection fails when processing many entities due to inefficient physics queries or improper layer masking. This Skill provides performance tips for managing large numbers of entities and efficient PhysicsDirectSpaceState2D queries to resolve detection bottlenecks.