Set up 3D physics in Unity 6.3 LTS: Rigidbody movement and forces, colliders, triggers vs collisions, layer-based collision, raycasts, and joints.

Apache-2.0Auto-check passedGame Development

Install Unity Physics

skills CLI
$ npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-physics -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gamedev-skills/awesome-gamedev-agent-skills unity-physics --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gamedev-skills/awesome-gamedev-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/unity/unity-physics .claude/skills/unity-physics && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
unity-physics
GitHub stars
1.4k
Token cost
~2.1k tokens
SKILL.md length
768 words
Files
2 (incl. references)
Skills in repo
53
Repo updated
First seen
Licence
Apache-2.0

At a glance

Set up 3D physics in Unity 6.3 LTS: Rigidbody movement and forces, colliders, triggers vs collisions, layer-based collision, raycasts, and joints.

  • Works in 4 steps: Force-based movement in FixedUpdate… → Collision vs trigger callbacks → Ground check with a layer-masked raycast → …
  • Layer-based collision
  • SKILL.md covers When to use, Core workflow, Patterns and Pitfalls, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Unity Physics is an agent skill from gamedev-skills/awesome-gamedev-agent-skills. Set up 3D physics in Unity 6.3 LTS: Rigidbody movement and forces, colliders, triggers vs collisions, layer-based collision, raycasts, and joints. Use when adding a Rigidbody, handling OnCollisionEnter/OnTriggerEnter, tuning collision layers, casting rays, or when the user mentions Unity physics, AddForce, isKinematic, or linearVelocity.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/raycasting-and-joints.md`).

It sits in Game Development, covering Game development. The repository describes itself as: 74 game-dev skills for AI coding agents — Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox. Portable SKILL.md Agent Skills (the format Anthropic… The licence is Apache-2.0.

When your agent uses it

  • Layer-based collision
  • Adding a Rigidbody
  • Handling OnCollisionEnter/OnTriggerEnter
  • Tuning collision layers

Example prompts

  • “/unity-physics”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Force-based movement in FixedUpdate (with a speed clamp)
  2. Collision vs trigger callbacks
  3. Ground check with a layer-masked raycast
  4. Kinematic platform that still pushes bodies

What it can do on your machine

Read from SKILL.md and the folder at commit d4b0e35. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Unity Physics loads about 2.1k tokens when it runs, and up to ~3k if it reads all its reference files. Until then it costs about 88 tokens; SKILL.md has 768 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gamedev-skills/awesome-gamedev-agent-skills at commit d4b0e35, republished under its Apache-2.0 licence (© gamedev-skills). 768 words, ~2,141 tokens.

Download SKILL.mdSave it as .claude/skills/unity-physics/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
unity-physics
description
Set up 3D physics in Unity 6.3 LTS: Rigidbody movement and forces, colliders, triggers vs collisions, layer-based collision, raycasts, and joints. Use when adding a Rigidbody, handling OnCollisionEnter/OnTriggerEnter, tuning collision layers, casting rays, or when the user mentions Unity physics, AddForce, isKinematic, or linearVelocity.

Unity Physics (Rigidbody / PhysX)

Make objects move, collide, and detect each other with Unity 6.3 LTS's built-in 3D physics (PhysX). Get the FixedUpdate discipline, trigger-vs-collision rules, and collision layers right. Targets Unity 6.3 LTS (6000.3).

Unity 6.3 LTS rename: Rigidbody.velocity is now Rigidbody.linearVelocity (the old name is deprecated). Code copied from older tutorials will warn or fail to compile.

When to use

  • Use when giving an object physical motion (forces, velocity, gravity), responding to collisions or triggers, setting up collision layers/masks, raycasting for ground checks or line-of-sight, or connecting bodies with joints.
  • Use when scenes/prefabs contain Rigidbody + Collider components.

When not to use: 2D physics (Rigidbody2D, Collider2D) is a separate API — adapt the concepts but the types differ. Cross-engine feel tuning (timestep, jitter, tunnelling) → physics-tuning. Reading input that drives movement → unity-input-system.

Core workflow

  1. Add a Rigidbody to anything that should be simulated; add a Collider to anything that should be hit. A collision needs a Collider on both, and at least one Rigidbody.
  2. Do all physics in FixedUpdate. Read input in Update, store intent, then apply forces / set linearVelocity / call MovePosition in FixedUpdate.
  3. Move bodies through the physics API, not the Transform. Use AddForce, linearVelocity, or MovePosition — never assign transform.position to a non-kinematic Rigidbody (it teleports and breaks collision resolution).
  4. Pick collision vs trigger. A solid collision blocks and calls OnCollisionEnter; a Collider with Is Trigger checked passes through and calls OnTriggerEnter.
  5. Organise interactions with layers. Put objects on layers and edit the Layer Collision Matrix (Project Settings → Physics) so unrelated things don't test against each other.
  6. Verify with the Physics Debugger (Window → Analysis → Physics Debugger) and by watching for jitter; if fast objects pass through walls, raise Collision Detection mode.

Patterns

1. Force-based movement in FixedUpdate (with a speed clamp)
csharp
using UnityEngine;

[RequireComponent(typeof(Rigidbody))]
public class Mover : MonoBehaviour
{
    [SerializeField] private float accel = 30f, maxSpeed = 8f;
    private Rigidbody _rb;
    private Vector3 _input;   // set from Update / input system

    private void Awake() => _rb = GetComponent<Rigidbody>();

    private void FixedUpdate()
    {
        _rb.AddForce(_input * accel, ForceMode.Acceleration);     // mass-independent accel
        // Unity 6.3 LTS: linearVelocity (was 'velocity'). Clamp horizontal speed.
        Vector3 flat = new(_rb.linearVelocity.x, 0, _rb.linearVelocity.z);
        if (flat.magnitude > maxSpeed)
        {
            flat = flat.normalized * maxSpeed;
            _rb.linearVelocity = new Vector3(flat.x, _rb.linearVelocity.y, flat.z);
        }
    }
}

ForceMode: Force (continuous, mass-scaled), Acceleration (continuous, ignores mass), Impulse (instant, mass-scaled — jumps), VelocityChange (instant, ignores mass).

2. Collision vs trigger callbacks
csharp
// Solid hit: both have colliders, this one has a (non-kinematic) Rigidbody.
private void OnCollisionEnter(Collision col)
{
    Debug.Log($"Hit {col.gameObject.name} at {col.contacts[0].point}");
}

// Overlap: one collider has 'Is Trigger' = true. Requires a Rigidbody on at least one party.
private void OnTriggerEnter(Collider other)
{
    if (other.CompareTag("Pickup")) Destroy(other.gameObject);
}
3. Ground check with a layer-masked raycast
csharp
[SerializeField] private LayerMask groundMask;   // set to your "Ground" layer in the Inspector

private bool IsGrounded()
{
    // Cast a short ray down; only test colliders on groundMask.
    return Physics.Raycast(transform.position, Vector3.down, out RaycastHit hit,
                           1.1f, groundMask);
}
4. Kinematic platform that still pushes bodies
csharp
// isKinematic Rigidbody: not driven by forces, but MovePosition interpolates and carries
// resting bodies correctly (unlike moving the Transform directly).
private void FixedUpdate() => _rb.MovePosition(_rb.position + Vector3.right * (2f * Time.fixedDeltaTime));

Pitfalls

  • Rigidbody.velocity doesn't exist in Unity 6.3 LTS — use linearVelocity (and angularVelocity is unchanged).
  • Setting transform.position on a dynamic Rigidbody — teleports it, skips collision. Use MovePosition (kinematic/interpolated) or apply forces. If you do write the transform, physics queries (Raycast, OverlapSphere) see the old position until the next physics step — call Physics.SyncTransforms() once before a same-frame query, never every frame.
  • OnCollisionEnter never fires on a CharacterController — CharacterController.Move bypasses the Rigidbody system; it reports hits via OnControllerColliderHit(ControllerColliderHit) instead. Don't add a Rigidbody to "fix" it — the two are mutually exclusive movement modes.
  • Physics.Raycast ignores triggers by default — a ray won't report a trigger collider unless you pass QueryTriggerInteraction.Collide (or flip the global Physics.queriesHitTriggers / Project Settings → Physics → Queries Hit Triggers). It also returns false when the ray origin starts inside the target collider.
  • A resting Rigidbody stays put after you move or disable what it rests on — below the Sleep Threshold a body goes to sleep. Collisions and AddForce wake it automatically, but moving a static collider (no Rigidbody) via its Transform may not, so the crate hangs in mid-air when the floor slides away. Call Rigidbody.WakeUp() on the affected bodies.
  • Applying forces in Update — frame-rate-dependent and jittery. Physics goes in FixedUpdate.
  • Trigger callbacks never fire — triggers need a Rigidbody on at least one of the two colliders, and both colliders enabled; two static triggers don't report overlaps.
  • Fast objects pass through walls (tunnelling) — raise the Rigidbody's Collision Detection from Discrete. Note Continuous sweeps against static colliders only (it falls back to Discrete against other dynamic bodies); Continuous Dynamic also sweeps against other continuous dynamic bodies; Continuous Speculative works against everything and is cheaper. For bullets, also consider a SphereCast/Raycast along the trajectory instead of a collider.
  • Non-uniform-scaled MeshColliders or scaled colliders misbehave; prefer primitive colliders and keep scale uniform.
  • A concave MeshCollider on a moving body — Mesh colliders are concave by default, and concave ones can only be static or kinematic; two concave colliders never collide at all. For a dynamic Rigidbody enable Convex on the MeshCollider, or build a compound collider from primitives.
  • Everything collides with everything — wasted cost; assign layers and prune the Layer Collision Matrix.
Show full SKILL.md (80 more words)Show less

References

  • For raycast variants (SphereCast, RaycastAll, OverlapSphere, LayerMask bit math) and joints (FixedJoint, HingeJoint, ConfigurableJoint, breakable joints), read references/raycasting-and-joints.md.
  • Primary docs: Unity Manual "Physics" section and ScriptReference/Rigidbody, ScriptReference/Physics.Raycast. For the added gotchas: ScriptReference/CollisionDetectionMode, ScriptReference/Physics-queriesHitTriggers, ScriptReference/MonoBehaviour.OnControllerColliderHit, ScriptReference/Physics.SyncTransforms, ScriptReference/Rigidbody.WakeUp, and the Manual pages "Introduction to rigid body physics" (sleeping) and "Introduction to Mesh colliders" (concave vs convex).
  • physics-tuning — engine-agnostic feel: fixed timestep, mass/drag, CCD, stability.
  • unity-csharp-scripting — the FixedUpdate/Update split these patterns rely on.
  • unity-navmesh — agent movement that is not force-driven.

© gamedev-skills, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/unity/unity-physics of gamedev-skills/awesome-gamedev-agent-skills.

  • SKILL.md
  • references/raycasting-and-joints.md

Open the folder on GitHubat commit d4b0e35

Compare with similar skills

Unity Physics next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Unity Physics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Unity Physics this skillgamedev-skills/awesome-gamedev-agent-skills1.4k—~2.1kAutomated safety check: PassApache-2.0
Godot Gdscript Patterns925236118/AlphaAgent10310 repos~5kAutomated safety check: PassMIT
Sprite Genaldegad/sprite-gen2.6k—~4.5kAutomated safety check: PassApache-2.0
2D Map and Scene Generator0x0funky/agent-sprite-forge4.3k—~2.9kAutomated safety check: PassMIT
Fantasy Framework Development Guideqq362946/Fantasy1.4k—~5.8kAutomated safety check: PassCustom licence
Package AddIvanMurzak/Unity-MCP4.4k1 repos~665Automated safety check: PassApache-2.0

Similar skills

  • Godot Gdscript Patterns

    925236118/AlphaAgent

    Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization.

    103 GitHub starsUsed in 10 repos~5k tokens
    Game DevelopmentAuto-check passed
  • Sprite Gen

    aldegad/sprite-gen

    Generates images and game sprites through GPT or Grok with guided provider choices, separate saved defaults, automatic cleanup and optional curation.

    2.6k GitHub stars~4.5k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • 2D Map and Scene Generator

    0x0funky/agent-sprite-forge

    Plans and builds 2D game maps and scenes, from tilemaps and parallax backgrounds to HD-2D plates, with collision checks, a playable HTML preview and Tiled, Godot or LDtk export.

    4.3k GitHub stars~2.9k tokensUpdated 2 days ago
    Game DevelopmentAuto-check passed
  • Development and review guide for the Fantasy C# distributed game server framework: ECS, FTask, routing, service discovery, config and databases.

    1.4k GitHub stars~5.8k tokensUpdated 7 days ago
    Game DevelopmentAuto-check passed
  • Package Add

    IvanMurzak/Unity-MCP

    Install a Unity package from the registry, a Git URL, or a local path.

    4.4k GitHub starsUsed in 1 repo~665 tokens
    Game DevelopmentAuto-check passed
  • Plays an authorized Game Boy or Game Boy Color ROM in one persistent headless Coffee GB session, inspecting frames and keeping an action trace for replay or tests.

    1.2k GitHub stars~1.3k tokensUpdated 7 days ago
    Game DevelopmentAuto-check passed

More from gamedev-skills/awesome-gamedev-agent-skills

All 53 skills in this repo
  • Create Game Assets

    gamedev-skills/awesome-gamedev-agent-skills

    Plan, generate, source, normalize, and validate cohesive visual game assets.

    1.4k GitHub stars~2k tokensUpdated 12 days ago
    Auto-check passed
  • Roblox UI

    gamedev-skills/awesome-gamedev-agent-skills

    Build production Roblox interfaces with ScreenGui/PlayerGui lifecycle, responsive UDim2 layouts, safe insets, reusable editable Instances, cross-device input and selection, restrained motion…

    1.4k GitHub stars~2.9k tokensUpdated 12 days ago
    Auto-check passed
  • AI Behavior Trees Utility AI

    gamedev-skills/awesome-gamedev-agent-skills

    Build a production behavior-tree runtime (Blackboard, action/condition leaves, sequence/selector/parallel composites, decorators) and a Utility AI system (response curves — linear, exponential…

    1.4k GitHub stars~2k tokensUpdated 12 days ago
    Auto-check passed
  • Bevy Ecs

    gamedev-skills/awesome-gamedev-agent-skills

    Structure a Bevy app around its Entity Component System: build the App with plugins, define Component/Resource types, write systems with Query/Res/Commands, filter and order systems, and use the…

    1.4k GitHub stars~2k tokensUpdated 12 days ago
    Auto-check passed
  • Card Game

    gamedev-skills/awesome-gamedev-agent-skills

    Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution.

    1.4k GitHub stars~1.6k tokensUpdated 12 days ago
    Auto-check passed
  • Fps Shooter

    gamedev-skills/awesome-gamedev-agent-skills

    Build a first-person shooter: move+mouse-look controller, hitscan or projectile shooting, weapons, health, and enemy AI.

    1.4k GitHub stars~1.5k tokensUpdated 12 days ago
    Auto-check passed

Questions about Unity Physics

What does Unity Physics do?

Set up 3D physics in Unity 6.3 LTS: Rigidbody movement and forces, colliders, triggers vs collisions, layer-based collision, raycasts, and joints. Unity Physics is an agent skill from gamedev-skills/awesome-gamedev-agent-skills.3 LTS: Rigidbody movement and forces, colliders, triggers vs collisions, layer-based collision, raycasts, and joints.

When should I use Unity Physics?

Unity Physics fits situations like: layer-based collision; adding a Rigidbody; handling OnCollisionEnter/OnTriggerEnter; tuning collision layers.

How do I install Unity Physics in Claude Code?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-physics -a claude-code`. Or copy the skill folder (skills/unity/unity-physics in gamedev-skills/awesome-gamedev-agent-skills) into .claude/skills/unity-physics in your project. Claude Code loads it when a task matches its description.

How do I install Unity Physics in Codex?

Run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-physics -a codex`. Or copy the skill folder (skills/unity/unity-physics in gamedev-skills/awesome-gamedev-agent-skills) into .agents/skills/unity-physics in your project. Codex loads it when a task matches its description.

Can I use Unity Physics in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-physics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/unity-physics, .gemini/skills/unity-physics, .github/skills/unity-physics and .opencode/skills/unity-physics in your project.

What does Unity Physics need to run?

SKILL.md names no scripts, command-line tools or credentials: Unity Physics is instructions for the agent only.

Does Unity Physics access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Unity Physics safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Unity Physics use?

Unity Physics is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Unity Physics use?

About 2.1k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 851 tokens, read only when the agent opens those files.

What are the alternatives to Unity Physics?

Skills that share tags, products or a category with Unity Physics: Godot Gdscript Patterns (925236118/AlphaAgent, 103 stars), Sprite Gen (aldegad/sprite-gen, 2.6k stars), 2D Map and Scene Generator (0x0funky/agent-sprite-forge, 4.3k stars) and Fantasy Framework Development Guide (qq362946/Fantasy, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Unity Physics?

gamedev-skills (a GitHub organization) maintains it in gamedev-skills/awesome-gamedev-agent-skills, which has 1,356 GitHub stars. The repository holds 53 skills in this directory. The repository was last updated on September 27, 2026.

Source: gamedev-skills/awesome-gamedev-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.