skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
besty0728/unity-skills83 installs

unity-physics

Run Unity physics queries and configure physics

How do I install this agent skill?

npx skills add https://github.com/besty0728/unity-skills --skill unity-physics
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides a set of tools for performing physics queries and managing physics settings within the Unity Editor. No security issues were detected.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

  • Runlayerpass

    1 file scanned · No issues

What does this agent skill do?

Unity Physics Skills

Editor-time physics queries (raycast, sphere and box casts, overlap), gravity, PhysicMaterial assets and the layer collision matrix. Parameters come from the schema (GET /skills/schema?names=<skill>&wire=v2); execution and dryRun rules: root SKILL.md.

When to use

  • Casting rays or shapes
  • Testing overlaps
  • Querying colliders
  • Adjusting gravity or physics settings

Rules

  • Each query is a single-frame check on the editor thread. Simulation (integration, collision response) advances only in Play Mode; these skills never start a simulation.
  • Raycast and cast results use world-space coordinates.
  • layerMask on queries is a bit mask (bit n = layer n; for example 256 = layer 8 only), not a layer index. -1 means all layers.
  • layer1 and layer2 on the layer-collision skills are indices 0-31. A name from layer1Name / layer2Name overrides the index on the same side.
  • Adding physics components belongs to the component module (component_add with Rigidbody, BoxCollider, etc.).

Pitfalls

  • physics_add_rigidbody, physics_add_collider and physics_simulate do not exist.
  • physics_raycast returns collider (the collider name) and objectName (the GameObject name), not hitObjectName.
  • A zero direction vector returns error: "Direction vector cannot be zero". Radius and half-extent values must be non-negative.
  • TARGET_NOT_FOUND on physics_set_material means the target has no Collider (add one with component_add) or the PhysicMaterial path did not load (check it with asset_find).
  • physics_create_material refuses a read-only package (registry, git or built-in) or a path no package owns with SEMANTIC_INVALID, before anything is created.

Skills

physics_raycast

Cast a ray and return the first hit.

ParameterTypeRequiredDefaultDescription
originX, originY, originZfloatYes-Ray origin
dirX, dirY, dirZfloatYes-Direction (normalized by the skill)
maxDistancefloatNo1000Max ray distance
layerMaskintNo-1Layer bit mask

Returns: {hit, collider, colliderEntityId, colliderInstanceId, objectName, objectEntityId, objectInstanceId, path, point, normal, distance}; {hit: false} on a miss.

physics_raycast_all

Cast a ray and return all hits, including those behind the first.

ParameterTypeRequiredDefaultDescription
originX, originY, originZfloatYes-Ray origin
dirX, dirY, dirZfloatYes-Direction
maxDistancefloatNo1000Max ray distance
layerMaskintNo-1Layer bit mask

Returns: {count, hits: [{objectName, instanceId, path, point, normal, distance}]}

physics_spherecast

Cast a sphere along a direction and return the first hit.

ParameterTypeRequiredDefaultDescription
originX, originY, originZfloatYes-Origin
dirX, dirY, dirZfloatYes-Direction
radiusfloatYes-Sphere radius
maxDistancefloatNo1000Max cast distance
layerMaskintNo-1Layer bit mask

Returns: {hit, objectName, entityId, instanceId, point, distance}

physics_boxcast

Cast a box along a direction and return the first hit.

ParameterTypeRequiredDefaultDescription
originX, originY, originZfloatYes-Origin
dirX, dirY, dirZfloatYes-Direction
halfExtentX, halfExtentY, halfExtentZfloatNo0.5Box half extents
maxDistancefloatNo1000Max cast distance
layerMaskintNo-1Layer bit mask

Returns: {hit, objectName, entityId, instanceId, point, distance}

physics_check_overlap

Check for colliders inside a sphere.

ParameterTypeRequiredDefaultDescription
x, y, zfloatYes-Sphere center
radiusfloatYes-Sphere radius, non-negative
layerMaskintNo-1Layer bit mask

physics_overlap_box

Check for colliders overlapping a box volume.

ParameterTypeRequiredDefaultDescription
x, y, zfloatYes-Box center
halfExtentX, halfExtentY, halfExtentZfloatNo0.5Box half extents
layerMaskintNo-1Layer bit mask

Returns: {count, colliders: [{objectName, path, isTrigger}]}

physics_get_gravity

Get the global gravity setting.

Parameters: none.

physics_set_gravity

Set the global gravity vector.

ParameterTypeRequiredDefaultDescription
x, y, zfloatYes-Gravity vector, e.g. 0, -9.81, 0

physics_create_material

Create a PhysicMaterial asset.

ParameterTypeRequiredDefaultDescription
namestringNo"New PhysicMaterial"Material name
savePathstringNo"Assets"Folder under Assets/, or inside an embedded or local package (Packages/<id>/...). Missing folders are created.
dynamicFrictionfloatNo0.6Dynamic friction
staticFrictionfloatNo0.6Static friction
bouncinessfloatNo0Bounciness

Returns: {success, path}. path is <savePath>/<name>.physicMaterial; a name already taken gets a numeric suffix (<name> 1.physicMaterial).

physics_set_material

Assign a PhysicMaterial to a collider.

ParameterTypeRequiredDefaultDescription
materialPathstringYes-Asset path of the PhysicMaterial
namestringNonullGameObject name
entityIdstringNonullGameObject entity ID (preferred; the only id on Unity 6000.4+)
instanceIdintNo0GameObject instance ID
pathstringNonullGameObject hierarchy path

Returns: {success, gameObject, material, collider}. material is the asset path read back from the collider; collider is the component type name (e.g. BoxCollider).

physics_get_layer_collision

Check whether two layers collide.

ParameterTypeRequiredDefaultDescription
layer1intNo-1First layer index (0-31); required unless layer1Name is given
layer2intNo-1Second layer index (0-31); required unless layer2Name is given
layer1NamestringNonullFirst layer name from Tags & Layers; overrides layer1 when given
layer2NamestringNonullSecond layer name from Tags & Layers; overrides layer2 when given

Returns: {layer1, layer2, collisionEnabled}

physics_set_layer_collision

Set whether two layers collide.

ParameterTypeRequiredDefaultDescription
layer1intNo-1First layer index (0-31); required unless layer1Name is given
layer2intNo-1Second layer index (0-31); required unless layer2Name is given
enableCollisionboolNotrueWhether the two layers collide
layer1NamestringNonullFirst layer name from Tags & Layers; overrides layer1 when given
layer2NamestringNonullSecond layer name from Tags & Layers; overrides layer2 when given

Returns: {success, layer1, layer2, collisionEnabled}

Example

Raycast downward from (0, 5, 0):

curl -s "http://localhost:<port>/skill/physics_raycast?expectProject=<project>" -d '{"originX":0,"originY":5,"originZ":0,"dirX":0,"dirY":-1,"dirZ":0,"maxDistance":10}'

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/besty0728/unity-skills/unity-physics">View unity-physics on skillZs</a>