$npx -y skills add TabooHarmony/roblox-brain --skill roblox-physicsUse when building Roblox vehicles, ragdolls, projectiles, elevators, constraints, forces, or other physics-driven gameplay.
| 1 | ## When to Load |
| 2 | |
| 3 | Use this skill when building physics-driven gameplay: vehicles, ragdolls, projectiles, mechanical contraptions, elevators, swinging platforms, or anything using constraints and forces. |
| 4 | |
| 5 | ## Quick Reference |
| 6 | |
| 7 | ### Constraint Types |
| 8 | **Mechanical:** `HingeConstraint`, `PrismaticConstraint`, `CylindricalConstraint`, `BallSocketConstraint`, `UniversalConstraint`, `WeldConstraint`/`RigidConstraint` |
| 9 | **Motion:** `AlignPosition`, `AlignOrientation`, `LinearVelocity`, `AngularVelocity`, `VectorForce`, `Torque` |
| 10 | **Spring/Rope:** `SpringConstraint`, `RopeConstraint`, `RodConstraint` |
| 11 | |
| 12 | ### Attachment Pattern |
| 13 | Constraints connect via `Attachment` objects. Create one on each part, set `Attachment0`/`Attachment1`, and parent the constraint to part0. Actuator types include `None`, `Motor`, and `Servo`. |
| 14 | |
| 15 | ### Vehicles |
| 16 | Vehicles: use motorized `HingeConstraint` wheels, `SpringConstraint` suspension, servo steering, and `CustomPhysicalProperties` for friction tuning. |
| 17 | |
| 18 | ### Ragdoll |
| 19 | Replace Motor6Ds with `BallSocketConstraint`: create Attachments from motor.C0/C1, set `LimitsEnabled=true`, `UpperAngle=45`. Keep Root Motor6D for HRP. Set humanoid state to `Physics`. Re-enable motors to recover. |
| 20 | |
| 21 | ### Authority and Network Ownership |
| 22 | Classic projects: automatic ownership can give an unanchored assembly to a nearby player. `SetNetworkOwner(nil)` keeps it server-owned; `SetNetworkOwner(player)` gives a player simulation ownership. Treat player-owned physics as untrusted and validate gameplay outcomes. |
| 23 | |
| 24 | Server Authority: set `Workspace.AuthorityMode = Server` with its required settings. Core objects can remain server-owned while prediction keeps controls responsive, so the classic secure-but-laggy trade-off does not apply. `SetNetworkOwner()` is not a substitute. |
| 25 | |
| 26 | **Rule:** choose the model first. Keep NPC and gameplay-critical objects authoritative; give client ownership to non-critical physics only when the resulting behavior is acceptable and tested. |
| 27 | |
| 28 | ### Common Gotchas |
| 29 | - Constraints do nothing on Anchored parts |
| 30 | - Both Attachment0 AND Attachment1 required (missing one = silent fail) |
| 31 | - Over-constraining = jitter. Tune mass with `CustomPhysicalProperties` |
| 32 | - Use Raycast for hitscan, `Touched` only for slow physics projectiles |
| 33 | - Always set lifetime on physics projectiles (forgotten ones kill perf) |
| 34 | **Need more detail?** Load `references/full.md` for the complete reference with code examples, API tables, and edge cases. |