wave5-physics-world-singleton-queries

Community

Run fast PhysicsWorld singleton spatial queries

AuthordyCuong03
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It solves the challenge of performing accurate runtime spatial queries in Unity DOTS by leveraging PhysicsWorldSingleton to query the current Unity Physics collision world.

Core Features & Use Cases

  • Raycast and collider cast: Determine closest hits or project shapes through the world for line-of-sight and impact prediction.
  • Distance and overlap queries: Find nearest bodies to a point and detect broad-phase AABB overlaps for targeting and area effects.
  • Correct scheduling and safety: Ensures dependencies are completed before reading PhysicsWorldSingleton and uses appropriate allocators for query results.

Use case example: Implement ground detection by casting a ray downward every simulation tick and reacting when the closest hit intersects the desired collision layer(s).

Quick Start

In your SimulationSystemGroup update, complete dependencies before reading PhysicsWorldSingleton, then schedule a job that uses PhysicsWorldSingleton.PhysicsWorld.CollisionWorld to run CastRay or OverlapAabb with a narrowed CollisionFilter.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: wave5-physics-world-singleton-queries
Download link: https://github.com/dyCuong03/unity-agent-team/archive/main.zip#wave5-physics-world-singleton-queries

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.