unity-physics

Run Unity editor physics queries and configure gravity, materials, and layer collisions.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-physics-pikachu0310
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-physics
Source: https://github.com/pikachu0310/codex-agent-ops-public/tree/main/.agents/skills/unity-skills/skills/physics
Command: npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-physics-pikachu0310

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It lets an AI agent perform Unity physics operations—raycasts, overlap checks, gravity configuration, PhysicMaterial creation, and layer collision matrix edits—directly in the Unity Editor without writing manual editor scripts. ## Core Features & Use Cases - Physics Queries: Cast rays, spheres, and boxes, or check overlaps to inspect colliders and hits in the scene at editor time. - Physics Configuration: Get or set global gravity, create PhysicMaterial assets, assign them to colliders, and read or modify the layer collision matrix. - Use Case: While building a level, ask the agent to raycast downward from a spawn point to verify ground placement, then create a high-friction PhysicMaterial and disable collisions between two layers. ## Quick Start Ask the agent to raycast from position (0, 5, 0) downward with a max distance of 10 and report what collider it hits.

Frequently Asked Questions about unity-physics

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

FAQPage Schema
How do I raycast in the Unity Editor from an AI agent?

Call physics_raycast with origin coordinates, a direction vector, and optional maxDistance and layerMask parameters. It returns hit status, collider name, and distance in world-space coordinates.

How do I change gravity in Unity programmatically?

Use physics_set_gravity with x, y, z values such as 0, -9.81, 0, and read the current value with physics_get_gravity. Setting gravity is a change operation that requires user grant in Approval mode.

Can this skill add Rigidbody or Collider components?

No, physics_add_rigidbody and physics_add_collider do not exist. Use the component module's component_add skill with componentType like Rigidbody or BoxCollider instead.

Does this module run physics simulation?

No, physics simulation only advances during Play mode. This module performs single-frame queries and writes assets or global settings on the editor thread without stepping the simulation.

Why does physics_set_material return TARGET_NOT_FOUND?

The target GameObject has no Collider, or the PhysicMaterial asset path could not be loaded. Add a collider via component_add or verify the material path with asset_find, then retry.