This skill teaches an agent how Unity 6.3 LTS physics works in both 3D (PhysX) and 2D. It covers moving bodies with forces and linearVelocity in FixedUpdate, choosing between collisions and triggers, pruning the layer collision matrix, and writing ground checks and line-of-sight rays.
It is written for the bugs that waste an afternoon: an object that falls through the floor, OnTriggerEnter that never fires, or a ground ray that hits the player itself. Each one is listed with its cause and the fix, and the skill ends with ways to verify the result.
What You Get
- A step-by-step workflow from identifying 3D or 2D physics to verifying the result
- C# patterns for force-based movement, ground checks and kinematic platforms
- A table of 3D versus 2D differences, such as OnCollisionEnter2D, RaycastHit2D and angularVelocity units
- A gotcha list covering silent callbacks, rays that stop on triggers, tunnelling and the Unity 6 renames
- Two reference files on 2D movement with Slide and one-way platforms, and on cast variants, LayerMask bit math and joints
Common Use Cases
- Fixing an object that falls through the floor or a trigger callback that never fires
- Writing a Rigidbody2D platformer mover with a contact-filter ground check
- Setting up layer collision pairs so bullets, enemies and pickups only touch what they should
- Migrating code from velocity and drag to linearVelocity and linearDamping after the Unity 6 renames
What Makes It Unique
The skill is specific to Unity 6.3 LTS and keeps 3D and 2D physics apart, since they never interact and fail silently when mixed. It points out that a 3D-named callback on a 2D object never runs, and it carries the Unity 6 API renames. It defers engine-neutral feel tuning, tilemap colliders and NavMesh to sibling skills, so it stays on the Unity physics API.
Under The Hood
The agent reads the SKILL.md and loads the two reference files only when the task needs them. It is told to grep scene and prefab YAML and the ProjectSettings assets to find the physics settings, so it reads files in your project. To verify, it can run the Unity command line tool against an open Editor, evaluate scripts with it, start Play mode, or run PlayMode tests in batch mode and read the NUnit results. It does not fetch web pages or call outside services itself, and it asks you to change the layer matrix in Project Settings.