Unity Physics logo

Unity Physics

CommunityPopular
Besty0728
unity-physics

Run Unity physics queries and configure physics

Overview

PublisherBesty0728
RepositoryUnity-Skills
Skill nameunity-physics
Stars
1.8K
Forks
164
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Besty0728 on GitHub. Read the source before you install it.

Installation

Install the Unity Physics AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Unity Physics in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Unity Physics on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Unity Physics is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.

Triggers

  • Casting rays
  • Testing overlaps
  • Querying colliders
  • Adjusting gravity/physics settings
  • 发射射线、检测重叠、查询碰撞体、调整重力/物理设置

Physics Skills

Editor-time physics queries (raycast / overlap), gravity, PhysicMaterial assets, and layer collision matrix.

Operating Mode

  • Approval:查询类 skill(physics_raycast / physics_check_overlap / physics_get_gravity / physics_get_layer_collision 等,源码标 SkillMode.SemiAuto)直接执行;变更类(physics_set_gravity / physics_create_material / physics_set_material / physics_set_layer_collision,标 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass:所有 skill 直接执行;Auto 走 AI 自我评估,Bypass 全放行。
  • 本模块不含 Delete / PlayMode / Reload / 高危 skill,无 Bypass-only 拦截项。
  • 注意:所有 skill 都在编辑器线程同步运行。真实物理模拟(积分、碰撞响应)仅在 Play mode 下推进;本模块只做单帧 query + 资产/全局设置写入,不会启动模拟。

DO NOT (common hallucinations):

  • physics_add_rigidbody / physics_add_collider do not exist → use component_add with componentType "Rigidbody"/"BoxCollider"/etc.
  • physics_simulate does not exist → physics simulation runs during Play mode; this module does not step the simulation
  • Raycast results use world-space coordinates

Routing:

  • For adding physics components → use component module
  • For physics material → use physics_create_material (this module)
  • For layer collision matrix → physics_set_layer_collision (this module)

Skills

physics_raycast

Cast a ray and get hit info. Parameters:

  • originX, originY, originZ (float): Origin point.
  • dirX, dirY, dirZ (float): Direction vector.
  • maxDistance (float, optional): Max distance (default 1000).
  • layerMask (int, optional): Layer mask (default -1).

Returns: { hit: true, collider: "Cube", distance: 5.2, ... }

physics_check_overlap

Check for colliders in a sphere. Parameters:

  • x, y, z (float): Center point.
  • radius (float): Sphere radius.
  • layerMask (int, optional): Layer mask.

physics_get_gravity

Get global gravity setting. Parameters: None.

physics_set_gravity

Set global gravity setting. Parameters:

  • x, y, z (float): Gravity vector (e.g. 0, -9.81, 0).

physics_raycast_all

Cast a ray and return ALL hits (penetrating).

ParameterTypeRequiredDefaultDescription
originXfloatYes-Ray origin X
originYfloatYes-Ray origin Y
originZfloatYes-Ray origin Z
dirXfloatYes-Direction X
dirYfloatYes-Direction Y
dirZfloatYes-Direction Z
maxDistancefloatNo1000Max ray distance
layerMaskintNo-1Layer mask filter

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

physics_spherecast

Cast a sphere along a direction and get hit info.

ParameterTypeRequiredDefaultDescription
originXfloatYes-Origin X
originYfloatYes-Origin Y
originZfloatYes-Origin Z
dirXfloatYes-Direction X
dirYfloatYes-Direction Y
dirZfloatYes-Direction Z
radiusfloatYes-Sphere radius
maxDistancefloatNo1000Max cast distance
layerMaskintNo-1Layer mask filter

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

physics_boxcast

Cast a box along a direction and get hit info.

ParameterTypeRequiredDefaultDescription
originXfloatYes-Origin X
originYfloatYes-Origin Y
originZfloatYes-Origin Z
dirXfloatYes-Direction X
dirYfloatYes-Direction Y
dirZfloatYes-Direction Z
halfExtentXfloatNo0.5Box half extent X
halfExtentYfloatNo0.5Box half extent Y
halfExtentZfloatNo0.5Box half extent Z
maxDistancefloatNo1000Max cast distance
layerMaskintNo-1Layer mask filter

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

physics_overlap_box

Check for colliders overlapping a box volume.

ParameterTypeRequiredDefaultDescription
xfloatYes-Box center X
yfloatYes-Box center Y
zfloatYes-Box center Z
halfExtentXfloatNo0.5Box half extent X
halfExtentYfloatNo0.5Box half extent Y
halfExtentZfloatNo0.5Box half extent Z
layerMaskintNo-1Layer mask filter

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

physics_create_material

Create a PhysicMaterial asset.

ParameterTypeRequiredDefaultDescription
namestringNo"New PhysicMaterial"Material name
savePathstringNo"Assets"Save directory path
dynamicFrictionfloatNo0.6Dynamic friction value
staticFrictionfloatNo0.6Static friction value
bouncinessfloatNo0Bounciness value

Returns: { success, path }

physics_set_material

Set PhysicMaterial on a collider (supports name/instanceId/path).

ParameterTypeRequiredDefaultDescription
materialPathstringYes-Asset path of the PhysicMaterial
namestringNonullGameObject name
instanceIdintNo0GameObject instance ID
pathstringNonullGameObject hierarchy path

Returns: { success, gameObject, material }

physics_get_layer_collision

Get whether two layers collide.

ParameterTypeRequiredDefaultDescription
layer1intYes-First layer index
layer2intYes-Second layer index

Returns: { layer1, layer2, collisionEnabled }

physics_set_layer_collision

Set whether two layers collide.

ParameterTypeRequiredDefaultDescription
layer1intYes-First layer index
layer2intYes-Second layer index
enableCollisionboolNotrueWhether to enable collision

Returns: { success, layer1, layer2, collisionEnabled }


Minimal Example

python
import unity_skills

# Raycast from position downward, check for hits
result = unity_skills.call_skill("physics_raycast",
    originX=0, originY=5, originZ=0,
    dirX=0, dirY=-1, dirZ=0,
    maxDistance=10
)
if result.get("hit"):
    print(f"Hit: {result['hitObjectName']} at distance {result['distance']}")

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.

Common Errors

Full transport-level codes (COMPILING/RATE_LIMIT etc.) → ../../references/protocol-error-codes.md

ErrorTriggerFix
SEMANTIC_INVALIDAn invalid value was supplied, such as a zero direction vector, a name containing path separators, or an out-of-range parameter.Provide a non-zero direction, remove path separators from the material name, and clamp values to the valid range.
TARGET_NOT_FOUNDThe target GameObject has no Collider, or the requested PhysicMaterial asset could not be loaded.Add a collider via component_add or verify the material path with asset_find, then retry.
MISSING_PARAMA required parameter is missing, such as name in physics_create_material.Provide the parameter named in the error; use mode=dryRun for the schema.

Frequently asked questions

What does the Unity Physics AI skill do?

Run Unity physics queries and configure physics

Why use Unity Physics on TypingMind?

Because you install it once and use it with any model. Unity Physics is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Unity Physics in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/physics. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Unity Physics?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Unity Physics?

As many as you like. As long as a model supports skills, you can use Unity Physics with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Unity Physics AI skill free?

Yes. It is published on GitHub by Besty0728 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇