What problem does it solve?
Unity projects often require programmatic physics queries and configuration for collision detection, debugging, and gameplay logic, and doing this repeatedly with low-level code is error-prone and time-consuming. This Skill centralizes common physics operations so developers can perform raycasts, overlap checks, and manage gravity, materials, and layer collision settings consistently.
Core Features & Use Cases
- Raycasts & Cast Variants: Single raycast, raycast all, spherecast, and boxcast to detect hits and gather world-space hit information including point, normal, distance, and object metadata.
- Overlap Queries: Sphere and box overlap checks to enumerate colliders in a volume for proximity triggers and area checks.
- Physics Configuration: Get and set global gravity, create and assign PhysicMaterial assets, and read or modify layer collision settings to control interaction rules between layers.
- Use Case: Use raycast and overlap checks to implement enemy sight and area-of-effect detection, create a PhysicMaterial for slippery surfaces, and disable collisions between two layers during a specific gameplay phase.
Quick Start
Use the unity-physics skill to cast a ray from origin 0,1,0 toward direction 0,-1,0 with maxDistance 10 and return the first hit result.