unity-physics

Perform raycasts, spherecasts, boxcasts, and overlap checks in Unity scenes.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/Yuan-Zzzz/FrogRE --skill unity-physics-yuan-zzzz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-physics
Source: https://github.com/Yuan-Zzzz/FrogRE/tree/main/.codex/skills/unity-skills/skills/physics
Command: npx skills add https://github.com/Yuan-Zzzz/FrogRE --skill unity-physics-yuan-zzzz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a consistent way to perform physics queries and update physics settings in Unity projects so developers and automation tools can inspect collisions, tune materials, and control gravity without manual scene inspection.

Core Features & Use Cases

  • Raycasts & Cast Variants: Single and multi-hit raycasts, spherecasts, and boxcasts that return structured hit data including point, normal, distance, and object metadata.
  • Overlap Checks: Sphere and box overlap queries to detect nearby colliders for AI, spawning, or trigger logic.
  • Physics Configuration: Get and set global gravity, create and assign PhysicMaterial assets, and read or modify the layer collision matrix for gameplay tuning and editor automation.
  • Use Case: Use this Skill to debug why a character is not colliding with the environment by performing targeted raycasts, checking overlap volumes, and verifying layer collision settings.

Quick Start

Ask the unity-physics skill to perform a raycast from (0,1,0) downwards (0,-1,0) with maxDistance 10 and return the first hit's object name, point, normal, and distance.

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 specific world coordinates to check for colliders?

To perform a Unity raycast, provide explicit world-space coordinates, direction vectors, layer masks, and max distance. The query returns structured hit data including point, normal, distance, and object metadata for deterministic collision detection.

Can I check overlapping colliders in Unity using sphere and box volumes?

Yes, Unity physics overlap checks support sphere and box queries to detect nearby colliders. These overlap checks return collider metadata useful for AI logic, dynamic spawning, and trigger volume verification without manual scene inspection.

What is the best way to configure Unity gravity and PhysicMaterial for gameplay tuning?

The best way to configure Unity gravity and PhysicMaterial is through physics configuration operations. You can get and set global gravity, create and assign PhysicMaterial assets via specified asset paths, and read or modify the layer collision matrix.

Why does my Unity character not collide with the environment during gameplay?

Unity character collision failures can be debugged by performing targeted raycasts, checking overlap volumes around the character, and verifying the layer collision matrix settings to ensure the appropriate layer masks are enabled for interaction.

Does Unity physics support multi-hit raycasts and boxcasts for scene automation?

Yes, Unity physics supports single and multi-hit raycasts, spherecasts, and boxcasts. These casts return structured hit data including distance and normal vectors, enabling deterministic tooling and editor automation for scene inspection.

How do I manage the Unity layer collision matrix for debugging trigger logic?

You can manage the Unity layer collision matrix by reading or modifying it through physics configuration operations. This allows you to verify layer mask settings and control which layers interact, enabling precise trigger logic and gameplay tuning.