unity-physics
Unity 6.3 LTS physics in 3D and 2D: Rigidbody and Rigidbody2D, forces and linearVelocity, the layer collision matrix and raycasts
Install / Use
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-physicsInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Project & Program ManagementSupported Platforms
Tags
Our assessment of unity-physics
unity-physics scores 95/100 on our quality scale, 1st of 83 Project & Program Management skills we index (top 2%).
Its SKILL.md is 8.4 KB long, well organised into 11 sections with 4 code examples: a thorough specification that gives an agent plenty to work with.
With 8,904 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 4 days ago, so unity-physics is actively maintained.
- Our last check on 2026-11-15 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-08. Automated pattern scan on 2026-10-08. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
unity-physics compared with similar skills
All 4 of these similar skills score higher than unity-physics; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| unity-physics (this skill)by gamedev-skills | 95 | 8.9k | 4d ago | SKILL.md |
| x402by browser-use | 100 | 121.0k | 3d ago | SKILL.md |
| algorithmic-artby anthropics | 100 | 177.9k | 55d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 55d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 149.0k | 6d ago | SKILL.md |
Frequently asked questions
- How do I install unity-physics?
- Run
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill unity-physics. The install tabs above show the steps for each supported agent. - Which AI agents does unity-physics work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is unity-physics safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is unity-physics still maintained?
- The repository was last updated 4 days ago, so unity-physics is actively maintained.
Skill content
View source on GitHubname: 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.velocityis nowRigidbody.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+Collidercomponents.
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
- Add a
Rigidbodyto anything that should be simulated; add aColliderto anything that should be hit. A collision needs aCollideron both, and at least oneRigidbody. - Do all physics in
FixedUpdate. Read input inUpdate, store intent, then apply forces / setlinearVelocity/ callMovePositioninFixedUpdate. - Move bodies through the physics API, not the Transform. Use
AddForce,linearVelocity, orMovePosition— never assigntransform.positionto a non-kinematic Rigidbody (it teleports and breaks collision resolution). - Pick collision vs trigger. A solid collision blocks and calls
OnCollisionEnter; aColliderwithIs Triggerchecked passes through and callsOnTriggerEnter. - 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.
- 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)
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
// 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
[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
// 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.velocitydoesn't exist in Unity 6.3 LTS — uselinearVelocity(andangularVelocityis unchanged).- Setting
transform.positionon a dynamic Rigidbody — teleports it, skips collision. UseMovePosition(kinematic/interpolated) or apply forces. If you do write the transform, physics queries (Raycast,OverlapSphere) see the old position until the next physics step — callPhysics.SyncTransforms()once before a same-frame query, never every frame. OnCollisionEnternever fires on aCharacterController—CharacterController.Movebypasses the Rigidbody system; it reports hits viaOnControllerColliderHit(ControllerColliderHit)instead. Don't add a Rigidbody to "fix" it — the two are mutually exclusive movement modes.Physics.Raycastignores triggers by default — a ray won't report a trigger collider unless you passQueryTriggerInteraction.Collide(or flip the globalPhysics.queriesHitTriggers/ Project Settings → Physics → Queries Hit Triggers). It also returnsfalsewhen 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
AddForcewake 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. CallRigidbody.WakeUp()on the affected bodies. - Applying forces in
Update— frame-rate-dependent and jittery. Physics goes inFixedUpdate. - Trigger callbacks never fire — triggers need a
Rigidbodyon 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. NoteContinuoussweeps against static colliders only (it falls back to Discrete against other dynamic bodies);Continuous Dynamicalso sweeps against other continuous dynamic bodies;Continuous Speculativeworks against everything and is cheaper. For bullets, also consider aSphereCast/Raycastalong the trajectory instead of a collider. - Non-uniform-scaled
MeshColliders or scaled colliders misbehave; prefer primitive colliders and keep scale uniform. - A concave
MeshCollideron 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.
References
- For raycast variants (
SphereCast,RaycastAll,OverlapSphere,LayerMaskbit math) and joints (FixedJoint,HingeJoint,ConfigurableJoint, breakable joints), readreferences/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).
Related skills
physics-tuning— engine-agnostic feel: fixed timestep, mass/drag, CCD, stability.unity-csharp-scripting— theFixedUpdate/Updatesplit these patterns rely on.unity-navmesh— agent movement that is not force-driven.
Related Skills
x402
121.0kSet up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
149.0kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
