unity-physics

Perform raycasts, overlap checks, and physics configuration on Unity scenes.

8|1|Updated Oct 7, 2025
One-click install
npx skills add https://github.com/Zzulin/unity-project01 --skill unity-physics-zzulin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-physics
Source: https://github.com/Zzulin/unity-project01/tree/main/URP1/Plugins/Unity-Skills-main/SkillsForUnity/unity-skills~/skills/physics
Command: npx skills add https://github.com/Zzulin/unity-project01 --skill unity-physics-zzulin

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about unity-physics

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

FAQPage Schema
How do I perform a Unity raycast from a specific origin and direction?

To perform a Unity raycast, provide a world-space origin, direction vector, and maxDistance parameter to detect the first collider hit and return structured data including the hit point, normal, and distance.

Can I use spherecast and boxcast for area-based collision detection in Unity?

Yes, Unity physics queries support spherecast and boxcast variants by accepting radius or half extents parameters, allowing you to detect collider hits along a path and gather world-space hit information.

What's the best way to check all colliders within a specific volume in Unity?

The best way to check colliders in a Unity volume is using overlap queries like sphere and box overlap checks, which enumerate all colliders within defined bounds for proximity triggers and area checks.

How do I create and assign a PhysicMaterial for slippery surfaces in Unity?

You can create and assign a Unity PhysicMaterial asset through physics configuration operations, enabling you to define friction and bounce properties for surface interactions like slippery floors.

Does this Unity physics approach work for runtime debugging and editor scene queries?

Yes, these Unity physics queries and configuration operations are applicable to both Unity Editor and runtime debugging, supporting scene queries, material creation, and layer collision adjustments in game development workflows.

How do I disable collisions between two specific Unity layers during gameplay?

You can disable collisions between two Unity layers by reading or modifying layer collision settings, allowing you to control interaction rules between specific layers during a specific gameplay phase.