physics-collisions

Guide Better ECS physics world snapshots, collision layers, filtering, and gameplay queries.

Updated Jan 1, 2026
One-click install
npx skills add https://github.com/ViewableGravy/better-ecs --skill physics-collisions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: physics-collisions
Source: https://github.com/ViewableGravy/better-ecs/tree/main/.github/skills/physics-collisions
Command: npx skills add https://github.com/ViewableGravy/better-ecs --skill physics-collisions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides clear guidance on how to effectively manage physics interactions, collision layers, and spatial queries within the Better ECS framework, ensuring accurate and efficient gameplay.

Core Features & Use Cases

  • Collision Management: Understand how entities participate in physics and collisions using layers and filters.
  • Querying Physics World: Learn to perform overlap checks and retrieve entities based on spatial criteria.
  • Runtime Workflow: Follow the per-frame lifecycle of physics world snapshots for consistent results.
  • Use Case: When developing a new gameplay mechanic that requires detecting if a player character is overlapping with an enemy or a specific environmental hazard, this Skill details the exact APIs and entity configurations needed.

Quick Start

Use the physics-collisions skill to understand how to add colliders to gameplay entities.

Frequently Asked Questions about physics-collisions

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

FAQPage Schema
How do I set up collision layers in Better ECS to filter entity interactions?

Collision layers in Better ECS use bigint mask checks to filter entity interactions. Entities must have a collider and CollisionParticipation component configured with the correct layer masks to participate in filtered physics queries.

What's the best way to query overlapping entities in a Better ECS physics world?

Use per-frame physics world snapshots to query overlapping entities. This Skill details the workflow for retrieving entities based on spatial criteria and performing overlap checks using the snapshot APIs for consistent gameplay results.

Why do I need per-frame physics world snapshots for collision detection?

Per-frame physics world snapshots ensure consistent collision detection results. Following the runtime workflow lifecycle of these snapshots prevents stale data issues when performing overlap queries and spatial lookups during gameplay mechanics.

Does Better ECS support collision filtering for specific gameplay hazards?

Better ECS supports collision filtering through bigint mask layer checks. You can configure entity colliders and CollisionParticipation components to detect overlaps between player characters and specific environmental hazards or enemies.

How do I add colliders to gameplay entities using Better ECS physics?

To add colliders to gameplay entities in Better ECS, you must configure entity collider components and ensure CollisionParticipation requirements are met. This setup enables physics resolution, overlap queries, and hitbox debugging.